Skip to main content

DeepTalk: Python and Prolog based dialogue agent

Project description

Project Description

** The system uses package text_graph_crafts based on dependency links for building Text Graphs, that with help of a centrality algorithm like PageRank, extract relevant keyphrases, summaries and relations from text documents.

A SWI-Prolog based module adds an interactive shell for talking about the document with a dialog agent that extracts for each query the most relevant sentences covering the document. Spoken dialog is also available if the OS supports it. Developed with Python 3, on OS X, but portable to Linux.**

Dependencies:

  • python 3.7 or newer, pip3, java 9.x or newer, SWI-Prolog 8.x or newer, graphviz
  • also, having git installed is recommended for easy updates
  • pip3 install text_graph_crafts

see how to activate other outputs in file

https://github.com/ptarau/TextGraphCrafts/blob/master/text_graph_crafts/deepRank.py

The second is activated with

python3 -i qpro.py

or the shorthand script qgo.

It requires SWI-Prolog to be installed and available in the path as the executable swipl and the Python to Prolog interface pyswip, to be installed with

pip3 install pyswip

It activates a Prolog process to which Python sends interactively queries about a selected document. Answers are computed by Prolog and then, if the parameter quiet is off, spoken using the say OS-level facility (available on OS X and Linux machines.

Prolog relation files, generated on the Python side are associated to each document as well as the queries about it. They are stored in the same directory as the document.

Try

>>> t1() 
...
>>> t9()
>>> t0()

or

>>> chat('const')

to interactively chat about the US Constitution. The same
for other documents in the examples folder.

### Handling PDF documents

The easiest way to do this is to install *pdftotext*, which is part of [Poppler tools](https://poppler.freedesktop.org/).

If pdftotext is installed, you can place a file like *textrank.pdf*
already in subdirectory pdfs/ and try something similar to:

pdf_chat('textrank')

which activates a dialog about the TextRank paper. Also

pdf_chat('logrank')

activates a dialog about *pdfs/logrank.pdf*, which describes
the architecture of the current system.

Change setting in file params.py to use the system with
other global parameter settings.




Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deep_talk-0.1.2.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

deep_talk-0.1.2-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file deep_talk-0.1.2.tar.gz.

File metadata

  • Download URL: deep_talk-0.1.2.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

File hashes

Hashes for deep_talk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b955f351c1e913a3bebdbca5da91a6c0530b34965944f6e798d4904e334a848e
MD5 d62a2dcbd0e52f93065486128578e0ff
BLAKE2b-256 be4bc060731322d64eb746c54817e8517f81b5d795a6d5a9f4c9c8b50498ee71

See more details on using hashes here.

File details

Details for the file deep_talk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: deep_talk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

File hashes

Hashes for deep_talk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e2356fd4ac44b28f0f521dc2f34e882aed8fb0283a8d6d95617ed12bf79d742b
MD5 960ebe5a25520e83b0abeda2b0ad12c2
BLAKE2b-256 b85644feaed83def9616f928709ed301782490094a1b43d107fb51038de6c3be

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page