Inference engine for generic example-based dialog/QA system.
100K+
This is a multi-purpose services for searching documents using various neural encoders in elastic search index. It is also designed convert raw objects (text, images etc) into the embedding space and store them in the elastic search index.
pip install -r requirements.txt
To make a pacakge, run:
python setup.py sdist
NeuralES uses ConvMind encoder python module (https://github.com/ConvMind/Encoders) to encode diverse data types using neural encoders. The following is a list of Encoder IDs that the application clients can use:
English:
Chinese:
A search query contains the following arguments:
NeuralES also supports auto-completion given some a prefix query.
Currently, NeuralES supports the following operations
{
context: [turn_1, turn2], # proceeding dialog history,
task_id: xxx # unique ID,
status: enable, # deleted, dsbale, enable, in_review
q: x,
q_paraphrases: [xx, xxx, xxx],
a: [{act: utterance, value: hi, type: text},
{act: page_navigation, value: xxx/a.html, type: navigation}] # same as our msg format
updated_time: timestamp,
user_id: tony # who created this entry
filters: {
expiration_date: null/date,
tags: [x, y, z],
category: FAQ # top-level folder
},
follow_up_questions: ?? // just learn from MS QnA bot. need to think more about it.
}
NES will always try to convert the external data into the following format:
{
q: x,
a: [{act: utterance, value: hi, type: text},
{act: page_navigation, value: xxx/a.html, type: navigation}] # same as our msg format
a_key: xxhhxx # a unique hashkey of a. can be obtained via hashlib
expire_time: xx
creation_time: xx
tags: [x, y, z]
category: xxx,
displayable: True/False # will it go to frequent_answers
}
[{act: utterance, value: hi, type: text},
{act: span, value: i am a man, type: text, answer_start: 421, chunk_id: xxx, doc_id: xxx},
{act: section, value: abstract, type: text, answer_start: 0, chunk_id: xxx, doc_id: xxx},
{act: title, value: ConvMind Handbook, type: text, answer_start: 0, chunk_id: xxx, doc_id: xxx}]
answer_start is the character-level offset in the chunk (defined by chunk_id). The chunk_id is a chunk that comes from document (defined by doc_id)
###Current filterable fields (growing):
###Data format:
Single filter, single value
{filters: {term: {key: value}}}
Single filter, multiple value
{filters: {terms: {key: [v1, v2]}}}
composed filters
{filters: [{term: {key: value}}, {terms: {key: []}}]
Content type
Image
Digest
Size
1.1 GB
Last updated
over 6 years ago
docker pull convmind/neural_es