Skip to content

Commit

Permalink
Move empty embedding logic to document manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Elleo committed Aug 3, 2018
1 parent fc1a88c commit a62f9ca
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions cape_responder/responder_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ def get_answers_from_documents(
if text is not None:
temp_id = 'Inline text-' + sha256(text.encode('utf-8')).hexdigest()
DocumentStore.create_document(user_token, "Inline text", "Inline text", text,
document_id=temp_id, replace=True,
get_embedding=Responder.get_empty_embeddings) # Don't generate embeddings for
# inline documents
document_id=temp_id, replace=True)
if document_ids is not None:
document_ids.append(temp_id)
else:
Expand Down Expand Up @@ -249,7 +247,3 @@ def reduce_results(future_answers, machine_reader_configuration: MachineReaderCo
@staticmethod
def get_document_embeddings(text):
return json.dumps(Responder.get_machine_reader().get_document_embedding(text).tolist())

@staticmethod
def get_empty_embeddings(text):
return ''

0 comments on commit a62f9ca

Please sign in to comment.