Spaces:
Sleeping
Sleeping
wzkariampuzha
commited on
Commit
•
4a14818
1
Parent(s):
6eb976a
Update epi_pipeline.py
Browse files- epi_pipeline.py +5 -2
epi_pipeline.py
CHANGED
@@ -659,10 +659,13 @@ class NER_Pipeline:
|
|
659 |
|
660 |
def __str__(self):
|
661 |
return "Instantiation: pipe = NER_Pipeline(name_or_path_to_model_folder)"+"\n Calling: output_dict = pipe(text)"
|
662 |
-
|
|
|
|
|
|
|
663 |
#Custom pipeline by WKariampuzha @NCATS (not Huggingface/Google/NVIDIA copyright)
|
664 |
@timeit
|
665 |
-
def
|
666 |
output_dict = {label:[] for label in self.labels}
|
667 |
|
668 |
dataset = NerDataset(text, self.bert_tokenizer, self.config)
|
|
|
659 |
|
660 |
def __str__(self):
|
661 |
return "Instantiation: pipe = NER_Pipeline(name_or_path_to_model_folder)"+"\n Calling: output_dict = pipe(text)"
|
662 |
+
|
663 |
+
def __call__(self, text:str, rd_identify:Union[GARD_Search,None] = None):
|
664 |
+
return self.getTextExtraction(text, rd_identify)
|
665 |
+
|
666 |
#Custom pipeline by WKariampuzha @NCATS (not Huggingface/Google/NVIDIA copyright)
|
667 |
@timeit
|
668 |
+
def getTextExtraction(self, text:str, rd_identify:Union[GARD_Search,None] = None):
|
669 |
output_dict = {label:[] for label in self.labels}
|
670 |
|
671 |
dataset = NerDataset(text, self.bert_tokenizer, self.config)
|