Spaces:
Sleeping
Sleeping
wzkariampuzha
commited on
Commit
•
c4d8834
1
Parent(s):
3a0cf71
Update extract_abs.py
Browse files- extract_abs.py +1 -1
extract_abs.py
CHANGED
@@ -97,7 +97,7 @@ def get_diseases(sentence:str, GARD_dict:Dict[str,str], max_length:int) -> Tuple
|
|
97 |
def init_NER_pipeline(name_or_path_to_model_folder:str = "ncats/EpiExtract4GARD-v2") -> Tuple[Any, Set[str]]: #NER_pipeline, entities = init_NER_pipeline()
|
98 |
tokenizer = BertTokenizer.from_pretrained(name_or_path_to_model_folder)
|
99 |
custommodel = AutoModelForTokenClassification.from_pretrained(name_or_path_to_model_folder)
|
100 |
-
customNER = pipeline('ner', custommodel, tokenizer=tokenizer, aggregation_strategy='
|
101 |
|
102 |
config = BertConfig.from_pretrained(name_or_path_to_model_folder)
|
103 |
labels = {re.sub(".-","",label) for label in config.label2id.keys() if label != "O"}
|
|
|
97 |
def init_NER_pipeline(name_or_path_to_model_folder:str = "ncats/EpiExtract4GARD-v2") -> Tuple[Any, Set[str]]: #NER_pipeline, entities = init_NER_pipeline()
|
98 |
tokenizer = BertTokenizer.from_pretrained(name_or_path_to_model_folder)
|
99 |
custommodel = AutoModelForTokenClassification.from_pretrained(name_or_path_to_model_folder)
|
100 |
+
customNER = pipeline('ner', custommodel, tokenizer=tokenizer, aggregation_strategy='none')
|
101 |
|
102 |
config = BertConfig.from_pretrained(name_or_path_to_model_folder)
|
103 |
labels = {re.sub(".-","",label) for label in config.label2id.keys() if label != "O"}
|