Spaces:
Sleeping
Sleeping
OnlyBiggg
commited on
Commit
·
309a937
1
Parent(s):
900edfa
fix truncate
Browse files- app/ner/services/ner.py +2 -5
app/ner/services/ner.py
CHANGED
|
@@ -30,15 +30,12 @@ class NER:
|
|
| 30 |
return_tensors="pt" # Make sure the tokenized inputs are returned as PyTorch tensors
|
| 31 |
)
|
| 32 |
|
| 33 |
-
# Get the prediction from the model
|
| 34 |
pred = self.model(**inputs)
|
| 35 |
|
| 36 |
-
# Convert model output to pipeline format
|
| 37 |
pred = self.pipeline.decode(pred.logits)
|
| 38 |
|
| 39 |
-
# pred = self.pipeline(text
|
| 40 |
-
|
| 41 |
-
# max_length=settings.MAX_LENGTH)
|
| 42 |
if entity_tag:
|
| 43 |
return self.extract_entities(pred, entity_tag)
|
| 44 |
return pred
|
|
|
|
| 30 |
return_tensors="pt" # Make sure the tokenized inputs are returned as PyTorch tensors
|
| 31 |
)
|
| 32 |
|
|
|
|
| 33 |
pred = self.model(**inputs)
|
| 34 |
|
|
|
|
| 35 |
pred = self.pipeline.decode(pred.logits)
|
| 36 |
|
| 37 |
+
# pred = self.pipeline(text)
|
| 38 |
+
|
|
|
|
| 39 |
if entity_tag:
|
| 40 |
return self.extract_entities(pred, entity_tag)
|
| 41 |
return pred
|