Skip to content

Commit

Permalink
Some minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
kehuangms committed Oct 3, 2019
1 parent eab5cc1 commit 1b4d1a5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions utils_nlp/models/transformers/named_entity_recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@

class TokenClassificationProcessor():
"""
Process raw dataset for training and testing, and post-process prediction
for token classification.
Process raw dataset for training and testing.
Args:
model_name (str, optional): The pretained model name.
Expand Down Expand Up @@ -96,7 +95,14 @@ def create_label_map(label_lists, trailing_piece_tag="X"):
return label_map


def preprocessForBERT(self, text, max_len=MAX_SEQ_LEN, labels=None, label_map=None, trailing_piece_tag="X"):
def preprocess_for_bert(
self,
text,
max_len=MAX_SEQ_LEN,
labels=None,
label_map=None,
trailing_piece_tag="X"
):
"""
Tokenize and preprocesses input word lists, involving the following steps
0. WordPiece tokenization.
Expand Down

0 comments on commit 1b4d1a5

Please sign in to comment.