Skip to content

Commit

Permalink
fix out of index for _extract_rel_text_keywords when use neo4j Neo4jG… (
Browse files Browse the repository at this point in the history
  • Loading branch information
younfor authored Mar 6, 2024
1 parent 5c81b75 commit 1f05153
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,20 @@ def _get_keywords(self, query_str: str) -> List[str]:
def _extract_rel_text_keywords(self, rel_texts: List[str]) -> List[str]:
"""Find the keywords for given rel text triplets."""
keywords = []

for rel_text in rel_texts:
keyword = rel_text.split(",")[0]
splited_texts = rel_text.split(",")

if len(splited_texts) <= 0:
continue
keyword = splited_texts[0]
if keyword:
keywords.append(keyword.strip("(\"'"))

# Return the Object as well
keyword = rel_text.split(",")[2]
if len(splited_texts) <= 2:
continue
keyword = splited_texts[2]
if keyword:
keywords.append(keyword.strip(" ()\"'"))
return keywords
Expand Down Expand Up @@ -222,6 +230,7 @@ def _retrieve(
rel_map = self._graph_store.get_rel_map(
list(subjs), self.graph_store_query_depth
)

logger.debug(f"rel_map: {rel_map}")

if not rel_map:
Expand Down

0 comments on commit 1f05153

Please sign in to comment.