arubenruben
commited on
Commit
•
438e391
1
Parent(s):
bc6e601
Update deploy_pipeline.py
Browse files- deploy_pipeline.py +4 -5
deploy_pipeline.py
CHANGED
@@ -46,15 +46,14 @@ class BERT_CRF_Pipeline(Pipeline):
|
|
46 |
def _sanitize_parameters(self, **kwargs):
|
47 |
return {}, {}, {}
|
48 |
|
49 |
-
def preprocess(self,
|
|
|
50 |
|
51 |
tokenizer = AutoTokenizer.from_pretrained(
|
52 |
"neuralmind/bert-base-portuguese-cased", do_lower_case=False)
|
|
|
|
|
53 |
|
54 |
-
TokenizeAndAlignLabelsStep().tokenize_and_align_labels(
|
55 |
-
examples=text, tokenizer=tokenizer)
|
56 |
-
|
57 |
-
return TokenizeAndAlignLabelsStep().tokenize_and_align_labels(examples=text, tokenizer=tokenizer)
|
58 |
|
59 |
def _forward(self, tokenizer_results):
|
60 |
|
|
|
46 |
def _sanitize_parameters(self, **kwargs):
|
47 |
return {}, {}, {}
|
48 |
|
49 |
+
def preprocess(self, inputs):
|
50 |
+
tokens = inputs['tokens']
|
51 |
|
52 |
tokenizer = AutoTokenizer.from_pretrained(
|
53 |
"neuralmind/bert-base-portuguese-cased", do_lower_case=False)
|
54 |
+
|
55 |
+
return TokenizeAndAlignLabelsStep().tokenize_and_align_labels(examples=tokens, tokenizer=tokenizer)
|
56 |
|
|
|
|
|
|
|
|
|
57 |
|
58 |
def _forward(self, tokenizer_results):
|
59 |
|