You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed an issue when experimenting with the map_terms() functions. When I attempt to map a single term, and the results do not have any words that are above the min score, I get a key error message. Here is my input:
I noticed an issue when experimenting with the map_terms() functions. When I attempt to map a single term, and the results do not have any words that are above the min score, I get a key error message. Here is my input:
And my error output:
KeyError Traceback (most recent call last)
/tmp/ipykernel_706701/365619315.py in
----> 1 dfl = text2term.map_terms(source_terms=["dengue virus infection"], max_mappings=3, min_score = 0.9,
2 target_ontology="ncit")
3 dfl
~/.local/lib/python3.10/site-packages/text2term/t2t.py in map_terms(source_terms, target_ontology, base_iris, csv_columns, excl_deprecated, max_mappings, min_score, mapper, output_file, save_graphs, save_mappings, source_terms_ids, separator, use_cache, term_type, incl_unmapped)
103 mappings_df = _do_mapping(source_terms, source_terms_ids, target_terms, mapper, max_mappings, min_score, tags,
104 incl_unmapped)
--> 105 mappings_df["Mapping Score"] = mappings_df["Mapping Score"].astype(float).round(decimals=3)
106 if save_mappings:
107 _save_mappings(mappings_df, output_file, min_score, mapper, target_ontology, base_iris,
~/.local/lib/python3.10/site-packages/pandas/core/frame.py in getitem(self, key)
4100 if self.columns.nlevels > 1:
4101 return self._getitem_multilevel(key)
-> 4102 indexer = self.columns.get_loc(key)
4103 if is_integer(indexer):
4104 indexer = [indexer]
~/.local/lib/python3.10/site-packages/pandas/core/indexes/range.py in get_loc(self, key)
415 raise KeyError(key) from err
416 if isinstance(key, Hashable):
--> 417 raise KeyError(key)
418 self._check_indexing_error(key)
419 raise KeyError(key)
KeyError: 'Mapping Score'
The text was updated successfully, but these errors were encountered: