Merge branch 'master' of git.xpub.nl:/var/www/git.xpub.nl/repos/OuNoPo-make

master
Alice 7 years ago
commit d7bffbaf48

@ -36,6 +36,12 @@ myscript: tesseract
wordtagger: tesseract
cat output/plain.txt | python3 src/wordtagger.py > output/tagged-words.txt
talktochatbot: tesseract
cat output/plain.txt | python3 src/textbotconversation.py
n+7: tesseract
cat output/plain.txt | python3 src/n_7.py > output/blah.txt
n+7: tesseract
cat output/plain.txt | python3 src/n_7.py > output/blah.txt

@ -0,0 +1,34 @@
from chatterbot import ChatBot
from sys import stdin, stderr, stdout
import nltk.data
text = stdin.read()
sent_detector = nltk.data.load('tokenizers/punkt/english.pickle')
sentences = sent_detector.tokenize(text.strip())
ns = []
chatbot = ChatBot(
'Ron Obvious',
trainer='chatterbot.trainers.ChatterBotCorpusTrainer',
output_format="text"
)
# Train based on the english corpus
chatbot.train("chatterbot.corpus.english")
for sen in sentences:
# Get a response to an input statement
response=chatbot.get_response(sen)
ns.append(sen)
ns.append(response.text)
file = open('output/whatdoesthechatbotsay.txt','w')
file.write("\n".join(ns))
file.close()
Loading…
Cancel
Save