Skip to content

Commit

Permalink
Exclude strings with no norm text
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Jul 6, 2023
1 parent b84028a commit ac7f04f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mira/dkg/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,15 @@ def get_grounder(self, prefix: Union[str, List[str]]) -> "gilda.grounder.Grounde

if isinstance(prefix, str):
prefix = [prefix]
terms = list(
itt.chain.from_iterable(
terms = [
term
for term in itt.chain.from_iterable(
self.get_grounder_terms(p) for p in tqdm(
prefix, desc="Caching grounding terms"
)
)
)
if term.norm_text
]
return Grounder(terms)

def get_node_counter(self) -> Counter:
Expand Down

0 comments on commit ac7f04f

Please sign in to comment.