"s'il te restait 4 candidats à voir, et que finalement il y en a plus que 2 dans la liste, 2 - 4 = -2"
while i < len(candidate_terms) devient while 0 <= i < len(candidate_terms) is possibly a first step to a fix
Full error:
olaf\pipeline\pipeline_component\concept_relation_extraction\synonym_concept_extraction.py:70: in run
concept_candidates = group_cts_on_synonyms(pipeline.candidate_terms)
olaf\commons\candidate_term_tools.py:34: in group_cts_on_synonyms
find_synonym_candidates(reference_term, candidate_terms, common_candidates)
def find_synonym_candidates(
reference_ct: CandidateTerm,
candidate_terms: List[CandidateTerm],
common_candidates: Set[CandidateTerm],
) -> None:
"""Find candidate terms with common synonyms based on
the reference term and group them in the a set.
If the candidate terms are candidate relations,
they should have the same source and destination concepts.
Parameters
----------
reference_ct : CandidateTerm
Candidate term used as reference to start the synonym search with.
candidate_terms : List[CandidateTerm]
List of candidate terms to compare with the reference term.
common_candidates : Set[CandidateTerm]
Set of candidate terms with common synonyms.
"""
i = 0
while i < len(candidate_terms):
check_source_destination = True
if isinstance(reference_ct, CandidateRelation):
check_source_destination = (
reference_ct.source_concept == candidate_terms[i].source_concept
and reference_ct.destination_concept
== candidate_terms[i].destination_concept
)
check_common_synonyms = cts_have_common_synonyms(
> reference_ct, candidate_terms[i]
)
E IndexError: list index out of range
olaf\commons\candidate_term_tools.py:69: IndexError
There is an index issue. We sometime end up with
IndexError: list index out of range
coming from (See full error at the end):Some thoughts:
while i < len(candidate_terms) devient while 0 <= i < len(candidate_terms)
is possibly a first step to a fixFull error: