Skip to content

Commit

Permalink
minor changes in engines
Browse files Browse the repository at this point in the history
  • Loading branch information
ngupta10 committed Apr 19, 2024
1 parent 34e229c commit 732f64b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions querent/core/transformers/bert_ner_opensourcellm.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ async def process_tokens(self, data: IngestedTokens):
self.set_termination_event()
return
if data.data:
single_string = ' '.join(data.data)
# clean_text = unidecode(single_string)
clean_text = single_string
clean_text = ' '.join(data.data)
else:
clean_text = data.data
if not data.is_token_stream :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ async def process_tokens(self, data: IngestedTokens):
self.set_termination_event()
return
if data.data:
single_string = ' '.join(data.data)
clean_text = single_string
# clean_text = unidecode(single_string)
clean_text = ' '.join(data.data)
else:
clean_text = data.data
if not data.is_token_stream :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ async def process_tokens(self, data: IngestedTokens):
await self.set_state(new_state=current_state)
else:
return
else:
return
except Exception as e:
self.logger.error(f"Invalid {self.__class__.__name__} configuration. Unable to extract predicates using GPT. {e}")
raise Exception(f"An error occurred while extracting predicates using GPT: {e}")
Expand Down
4 changes: 2 additions & 2 deletions querent/core/transformers/gpt_llm_gpt_ner.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ async def process_tokens(self, data: IngestedTokens):
doc_source = data.doc_source
if data.data:
clean_text = ' '.join(data.data)
#clean_text = unidecode(single_string)
else:
clean_text = data.data
if not data.is_token_stream :
Expand Down Expand Up @@ -258,7 +257,8 @@ async def process_tokens(self, data: IngestedTokens):
await self.set_state(new_state=current_state)
else:
return

else:
return
except Exception as e:
self.logger.debug(f"Invalid {self.__class__.__name__} configuration. Unable to extract predicates using GPT NER LLM class. {e}")

Expand Down

0 comments on commit 732f64b

Please sign in to comment.