ExactConceptParser can now recognize concepts by their names
This commit is contained in:
@@ -255,6 +255,26 @@ class BaseParser:
|
||||
|
||||
return start, end
|
||||
|
||||
@staticmethod
|
||||
def merge_concepts(list_a, b):
|
||||
if not b:
|
||||
return list_a
|
||||
|
||||
list_b = b if isinstance(b, list) else [b]
|
||||
|
||||
if not list_a:
|
||||
return list_b
|
||||
|
||||
by_ids = {c.id for c in list_b}
|
||||
for c in list_b:
|
||||
if c.id in by_ids: # and c.metadata.is_evaluated == by_ids[c.id].metadata.is_evaluated:
|
||||
continue
|
||||
|
||||
list_a.append(c)
|
||||
by_ids.add(c.id)
|
||||
|
||||
return list_a
|
||||
|
||||
|
||||
class BaseTokenizerIterParser(BaseParser):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user