AntonySJohn / eywa

Open source framework for building conversational agents [WIP]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eywa - Framework for Conversational Agents

Build Status

Eywa is an open source framework for building and deploying conversational agents (aka chatbots).

Features:

  • Requires only few samples for training
  • Instant retraining
  • Uses word embeddings + heuristics instead of deep learning (better debuggability and interpretability)

Quickstart

Classifier

from eywa.nlu import Classifier


x_hotel = ['book a hotel', 'need a nice place to stay', 'any motels near by']
x_weather = ['what is the weather like', 'is it hot outside']

clf = Classifier()
clf.fit(x_hotel, 'hotel')
clf.fit(x_weather, 'weather')

print(clf.predict('will it rain today'))  # >>> 'weather'
print(clf.predict('find a place to stay'))  # >>> 'hotel'

Entity extractor

from eywa.nlu import EntityExtractor

x = ['what is the weather in tokyo', 'what is the weather', 'what is the weather like in kochi']
y = [{'intent': 'weather', 'place': 'tokyo'}, {'intent': 'weather', 'place': 'here'}, {'intent': 'weather', 'place': 'kochi'}]

ex = EntityExtractor()
ex.fit(x, y)

x_test = 'what is the weather in london like'
print(ex.predict(x_test))

Pattern

from eywa.nlu import Pattern

p = Pattern('[fruit: apple, banana] is my favourite fruit')  # create variable [fruit] with sample values {apple, banana}

p('i like grapes')  # >> {'fruit' : 'grapes'}

Requirements

  • Python 3.6 or higher
  • Eywa requires Tensorflow 2.0 and should be installed manually by the user (is not installed automatically as a dependency)

Installation

Via pip:

pip install eywa

Install from source:

git clone https://www.github.com/farizrahman4u/eywa.git
cd eywa
python setup.py install

About

Open source framework for building conversational agents [WIP]

License:GNU General Public License v3.0


Languages

Language:Python 99.9%Language:Batchfile 0.1%Language:Shell 0.1%