Skip to main content

Flipgenic: High-speed conversational dialogue engine


What is it?

Flipgenic is a library for creating simple chatbots. A Flipgenic bot starts with an empty mind and learns how to communicate over time by reusing messages it has seen in previous conversations. It does not write anything original.

Here is an example from its use in Axyn:

Screenshot of example conversation

Flipgenic is focused on fast reply times and a simple API. Chatterbot, a more well-known library, has additional features such as custom filters and logic adapters.

How do I use it?

Here is a basic example:

# python -m pip install flipgenic
# python -m spacy download en_core_web_md

from flipgenic import Responder

# Create and connect to database
# This can take a while to load the spaCy models
responder = Responder('/path/to/data/folder/')

# Initialize the database with a single response
responder.learn_response('Hello', 'Hi!')

response = None
while True:
    text = input('> ')

    if response:
        # Learn the input as a response to the previous output
        responder.learn_response(response, text)

    # Generate a response
    response, distance = responder.get_response(text)
    print(response.text, f'({distance})')

For more, see ReadTheDocs.

How does it work?

  1. Upon calling get_response, the input is converted to a 300-dimensional vector. The vector embeddings for each word are provided by SpaCy; calculating the mean gives a single vector representing the whole text.
  2. A closest match is found by searching the vectors of previously seen messages. An NGT index improves performance.
  3. The search result corresponds to one or more known responses. These responses are stored in an SQLite database.
  4. We select a matching response at random. The same response might have been learned more than once, giving it a higher chance of selection.
  5. Along with the selected response, the distance between the input vector and the search result is returned as a confidence heuristic.

Metadata

Release files for flipgenic 2.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flipgenic 2.2.1
File Size Uploaded Provenance Actions
flipgenic-2.2.1.tar.gz 16.9 kB Without provenance Details for flipgenic-2.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flipgenic 2.2.1
File Interpreter ABI Platform Actions
flipgenic-2.2.1-py3-none-any.whl Python 3 none any Details for flipgenic-2.2.1-py3-none-any.whl

Total release size: 34.4 kB

Release files / flipgenic-2.2.1.tar.gz

Download URL flipgenic-2.2.1.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d977f0a39792ae15614791f2b8742c8bcf41425fc6cf4e80258c052737f33eef
BLAKE2b-256 checksum
How to use checksums
5913231d089ba10400b80b8bf3f04e89a3cabdb67c71e9d2b5cf1c07ea9bc4fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.11

Release files / flipgenic-2.2.1-py3-none-any.whl

Download URL flipgenic-2.2.1-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
799cd2808f0ae1c00ac654232865da86e14fb14b7ac79fa9a085ed47c90d0579
BLAKE2b-256 checksum
How to use checksums
6a318f2b3493a705836a0c9c816b05fbd24104e3016f01745825fe8cac7ebd8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.11

Security for flipgenic 2.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page