wzkariampuzha commited on
Commit
d2c6d3e
1 Parent(s): acee9d8

Update extract_abs.py

Browse files
Files changed (1) hide show
  1. extract_abs.py +1 -1
extract_abs.py CHANGED
@@ -94,7 +94,7 @@ def get_diseases(sentence:str, GARD_dict:Dict[str,str], max_length:int) -> Tuple
94
  ## Section: Prepare ML/DL Models
95
  # This fuction prepares the model. Should call before running in notebook. -- The [Any] Type is a Huggingface Pipeline variable
96
  # Default with typing from here: https://stackoverflow.com/questions/38727520/how-do-i-add-default-parameters-to-functions-when-using-type-hinting
97
- def init_NER_pipeline(name_or_path_to_model_folder:str = "./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='simple')
 
94
  ## Section: Prepare ML/DL Models
95
  # This fuction prepares the model. Should call before running in notebook. -- The [Any] Type is a Huggingface Pipeline variable
96
  # Default with typing from here: https://stackoverflow.com/questions/38727520/how-do-i-add-default-parameters-to-functions-when-using-type-hinting
97
+ def init_NER_pipeline(name_or_path_to_model_folder:str = "./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='simple')