Simple interface for working with intents and chatbots. A built upon version of Neuralnines package.
Project description
neuralintents
Still in a buggy alpha state.
Setting Up A Basic Assistant
from neuralintents import GenericAssistant
assistant = GenericAssistant('intents.json', model_name="test_model")
assistant.train_model()
assistant.save_model()
done = False
while not done:
message = input("Enter a message: ")
if message == "STOP":
done = True
else:
assistant.request(message)
Binding Functions To Requests
from neuralintents import GenericAssistant
def function_for_greetings():
print("You triggered the greetings intent!")
# Some action you want to take
def function_for_stocks():
print("You triggered the stocks intent!")
# Some action you want to take
mappings = {'greeting' : function_for_greetings, 'stocks' : function_for_stocks}
assistant = GenericAssistant('intents.json', intent_methods=mappings ,model_name="test_model")
assistant.train_model()
assistant.save_model()
done = False
while not done:
message = input("Enter a message: ")
if message == "STOP":
done = True
else:
assistant.request(message)
Sample intents.json File
{"intents": [
{"tag": "greeting",
"patterns": ["Hi", "How are you", "Is anyone there?", "Hello", "Good day", "Whats up", "Hey", "greetings"],
"responses": ["Hello!", "Good to see you again!", "Hi there, how can I help?"],
"context_set": ""
},
{"tag": "goodbye",
"patterns": ["cya", "See you later", "Goodbye", "I am Leaving", "Have a Good day", "bye", "cao", "see ya"],
"responses": ["Sad to see you go :(", "Talk to you later", "Goodbye!"],
"context_set": ""
},
{"tag": "stocks",
"patterns": ["what stocks do I own?", "how are my shares?", "what companies am I investing in?", "what am I doing in the markets?"],
"responses": ["You own the following shares: ABBV, AAPL, FB, NVDA and an ETF of the S&P 500 Index!"],
"context_set": ""
}
]
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neuralintentsplus-0.0.4.tar.gz.
File metadata
- Download URL: neuralintentsplus-0.0.4.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c693f955eecb261f5b3a36207aa90f1cd564b02ed9726ebf0bc9478c2867b9b7
|
|
| MD5 |
22696b74a1a0669cabd55fe224d630ef
|
|
| BLAKE2b-256 |
a300cee447ab5098e5c1a52b1a8e676f04e5e59d97b4f153ded9bdf813091b0a
|
File details
Details for the file neuralintentsplus-0.0.4-py3-none-any.whl.
File metadata
- Download URL: neuralintentsplus-0.0.4-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52b5b32ba30e650d6e84a26438b6323b0b0ccdc13abb739dbfd7a28847821d2c
|
|
| MD5 |
b7f9ca4c530b24ac685e8af048b9f765
|
|
| BLAKE2b-256 |
077b6a0de5b9a45ac3eaa7861cc808956bd8808e6635badb583e823c768fbeab
|