• Stars
    star
    159
  • Rank 235,916 (Top 5 %)
  • Language
    Prolog
  • License
    Apache License 2.0
  • Created almost 11 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Free and open source A.I. system based on Python, TensorFlow and Prolog.

Zamia AI

The Zamia AI project is a framework that provides a set of components needed to build completely free, open source end-to-end speech and natural language processing A.I. systems.

For more information about the Zamia AI project check out our homepage at:

Getting Started

Try Our Example Applications

The easiest way to see Zamia AI in action is to download one of our precompiled examples:

Chatbot

This is a simple text chat bot built on top of Zamia AI’s knowledge base. You can chat with the model by running the command:

zaicli chat

Here is a sample session giving you some ideas to get your conversation started:

[bofh@centos7 chatbot]$ zaicli chat
...
ai> okay computer
INFO:root:RESP: [   0.5] Greetings! | action: attention(on)
ai> what is your name
INFO:root:RESP: [   0.5] My name is "HAL 9000"
ai> who was the predecessor of barack obama
INFO:root:RESP: [   0.2] The predecessor of "Barack Obama" as "President of the United States of America" was "George W. Bush".
ai> what time is it
INFO:root:RESP: [   0.1] It is 6 minutes past 0
ai> are you a computer
INFO:root:RESP: [   0.1] Yes, I am a Computer. Are you knowledgeable about Computers?
ai> what is your favorite movie
INFO:root:RESP: [   1.0] 2001: A Space Odyssey by Stanley Kubrick
ai>

You can also run the chatbot application itself which shoud also give you a starting point on how to embed Zamia AI into you own applications:

./chatbot.py

Voice Assistant

This example show how Zamia AI can be combined with Zamia Speech Kaldi ASR Models and eSpeak NG to create a completely free, offline capable voice assistant.

Compiling Zamia AI Models

This tutorial uses the chatbot example that comes with Zamia AI. You can also find it online here:

to try it, create a directory and put all the source files there.

Now, the first step is to compile the skills that are used in this examples - i.e. Zamia AI will will compute all sample utterances plus their corresponding responses from the skills our toplevel.py skill depends on into an SQLite DB. To do this, we run the command

zaicli compile all

you can check out the number of utterances extracted from each skill using the command

zaicli stats

also, you can check the utterances extracted from all or specific skills using the command

zaicli utterances [-s skill]

Train word vectors using fastText:

wget 'http://goofy.zamia.org/zamia-speech/misc/sentences-en.txt.xz'
unxz sentences-en.txt.xz

zaicli utterances >utts.txt

cat utts.txt sentences-en.txt > corpus.txt
mkdir model
fasttext skipgram -input corpus.txt -output model/word_embeddings

Once we are satisfied it is time to train our NLP model which will allow Zamia AI to handle utterances that have no exact match in our DB:

zaicli train

Utterance Classification

Utterance classification is used to predict which of the existing skills a new utterance fits best. Can also be used on a text file containing one utterance per line.

Train the classifier:

zaicli utt_class_train

Run the prediction:

zaicli utt_class "Who is the current US President?"

Adapt the Kaldi Speech Recognition Model

Note
This is only needed for application that use voice input.
cat utts.txt utts.txt utts.txt utts.txt utts.txt sentences-en.txt >corpus5.txt

MODEL="/opt/kaldi/model/kaldi-generic-en-tdnn_sp"

cut -f 1 -d ' ' ${MODEL}/data/local/dict/lexicon.txt >vocab.txt
lmplz -o 4 --prune 0 1 2 3 --limit_vocab_file vocab.txt --interpolate_unigrams 0 <corpus5.txt >lm.arpa

rm -rf work
kaldi-adapt-lm ${MODEL} lm.arpa en-tdnn_sp
tar xfJ work/kaldi-en-tdnn_sp-adapt.tar.xz

Further Documentation

For other technical documentation, check out

License

My own scripts as well as the data I create is Apache-2.0 licensed unless otherwise noted in the script’s copyright headers.

Some scripts and files are based on works of others, in those cases it is my intention to keep the original license intact. Please make sure to check the copyright headers inside for more information.

Author

Guenter Bartsch <[email protected]>

More Repositories

1

zamia-speech

Open tools and data for cloudless automatic speech recognition
Python
443
star
2

py-kaldi-asr

Some simple wrappers around kaldi-asr intended to make using kaldi's (online) decoders as convenient as possible.
C++
170
star
3

drawilleplot

matplotlib backend for graph output in unicode terminals using drawille
Python
77
star
4

aqb

A BASIC Compiler and IDE for Amiga Computers
C
74
star
5

py-nltools

A collection of basic python modules for spoken natural language processing
Python
56
star
6

py-espeak-ng

Some simple wrappers around eSpeak NG intended to make using this excellent TTS for waveform and IPA generation as convenient as possible.
Python
38
star
7

kaldi-adapt-lm

Adapt Kaldi-ASR nnet3 chain models from Zamia-Speech.org to a different language model
Python
34
star
8

robinson

Tiny pyhton (cython) HTML layout engine with cairo surface rendering support
Python
20
star
9

zamia-prolog

Embeddable Prolog dialect implemented in pure Python. Stores its knowlegdebase using SQLAlchemy for scalability.
Python
19
star
10

py-vad-mh

Cython implementation of Moattar and Homayounpour's Voice Activity Detection (VAD) algorithm fast enough for real-time on an RPi 3.
Python
12
star
11

zerovox

zero-shot realtime TTS system, fully offline, free and open source
Python
12
star
12

zbrain

Infrastructure useful to create natural language processing systems based on transformer networks
Python
11
star
13

py-picotts

Python wrappers around SVOX Pico TTS
Python
9
star
14

py-marytts

Python MaryTTS HTTP client library
Python
8
star
15

zamia-tts

Tacotron based speech synthesizer
Python
8
star
16

tts-server

Simple REST-style HTTP TTS (text to speech) server based on MaryTTS, espeak and sequitur
Python
7
star
17

py-xsb

py-xsb is a Python - XSB bridge enabling querying XSB in your Python programs. It features a ctypes mapping of XSB's C-Interface as well as some higher level convenience wrappers.
Python
6
star
18

sparqlalchemy

Simple (buy hopefully reasonably efficient) implementation of an RDF triple store on top of SQLAlchemy
Python
4
star
19

cbmdisk

NODISKEMU based IEEE 488 + IEC floppy emulator with network/ftp support KiCAD schematic
C
4
star
20

FTS4

Amiga FTS4: File Transfer Serial, Version 4
C
3
star
21

g2p_de

A Simple Python Module for German Grapheme To Phoneme Conversion
Python
3
star
22

zamia-dist

Misc scripts and other files useful for building zamia/AI packages for various distributions
Shell
1
star
23

HTMLTerminal

HTML Terminal for RaspberryPi based embedded system using ZeroMQ for communication with host
Python
1
star