From 57c68a8743217b55eca9cb8227a2c7e017bcee93 Mon Sep 17 00:00:00 2001 From: ange Date: Fri, 23 Mar 2018 16:04:55 +0100 Subject: [PATCH 01/11] Changes in ttssr-human-only.sh --- src/ttssr/ttssr-loop-human-only.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ttssr/ttssr-loop-human-only.sh b/src/ttssr/ttssr-loop-human-only.sh index 9ec2b9c..05ac20b 100644 --- a/src/ttssr/ttssr-loop-human-only.sh +++ b/src/ttssr/ttssr-loop-human-only.sh @@ -8,7 +8,7 @@ while [[ $i -le 10 ]] python3 src/ttssr/write_audio.py src/sound$i.wav 2> /dev/null play src/sound$i.wav repeat 5 2> /dev/null & #in the background the sound, without it all the sounds play one by one//2 is stderr python3 src/ttssr/audio_transcribe.py sound$i.wav > output/input$((i+1)).txt 2> /dev/null - sleep + sleep 1 (( i++ )) done today=$(date +%Y%m%d.%H-%M); From 29132ec69af4470711081b917cdb0fae05bdb6dc Mon Sep 17 00:00:00 2001 From: Alice Date: Fri, 23 Mar 2018 16:08:12 +0100 Subject: [PATCH 02/11] Removed a dependency I was not using --- src/carlandre.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/carlandre.py b/src/carlandre.py index 2746f92..9b595f0 100644 --- a/src/carlandre.py +++ b/src/carlandre.py @@ -2,7 +2,6 @@ import pytest from math import ceil import sys from sys import stdout -import time import os.path From 7b7def3b7888c74e7738bd7b8b9f9b79ac6e54a6 Mon Sep 17 00:00:00 2001 From: jvdhorst Date: Fri, 23 Mar 2018 16:21:23 +0100 Subject: [PATCH 03/11] Added first version of README for Reading the Structure --- README | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/README b/README index bea5d99..60b15d1 100644 --- a/README +++ b/README @@ -48,11 +48,18 @@ run: `make ttssr-human-only` Specific Dependencies: * [pocketsphinx](https://github.com/bambocher/pocketsphinx-python) `sudo pip3 install pocketsphinx` ---> FOLLOW THIS EXAMPLE -* SpeechRecognition 3.8.1 -* PyAudio - - - +* SpeechRecognition 3.8.1 +* PyAudio +## Reading the Structure: Joca +Description: Uses OCR'ed text as an input, labels each word for Part-of-Speech, stopwords and sentiment. Then it generates a reading interface +where words with a specific label are hidden. Output can be saved as poster, or exported as json featuring the full data set. +run: `make output/reading_structure/index.html` +Specific Dependencies: +* nltk: nltk.tokenize.punkt, ne_chunk, pos_tag, word_tokenize, sentiment.vader +* weasyprint +* jinja2 +* font: PT Sans (os font https://www.fontsquirrel.com/fonts/pt-serif) +* font: Ubuntu Mono (os font https://www.fontsquirrel.com/fonts/ubuntu-mono) From 9be8ba788e56542cdedf1fcf6fff044ac0b9f527 Mon Sep 17 00:00:00 2001 From: Castro0o Date: Fri, 23 Mar 2018 16:24:00 +0100 Subject: [PATCH 04/11] pocket sphinx dependencies --- README | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README b/README index bea5d99..89b4453 100644 --- a/README +++ b/README @@ -47,9 +47,11 @@ Description: Speech recognition feedback loops using the first sentence of a sca run: `make ttssr-human-only` Specific Dependencies: -* [pocketsphinx](https://github.com/bambocher/pocketsphinx-python) `sudo pip3 install pocketsphinx` ---> FOLLOW THIS EXAMPLE -* SpeechRecognition 3.8.1 -* PyAudio +* PocketSphinx pacakge `sudo aptitude install pocketsphinx pocketsphinx-en-us` + +* Speech Recognition: `sudo pip3 install SpeechRecognition` +* TermColor: `sudo pip3 install termcolor` +* PyAudio: `pip3 install pyaudio` From 759fd5a5dfece73333c5a44cc94bfa6e87193401 Mon Sep 17 00:00:00 2001 From: jvdhorst Date: Fri, 23 Mar 2018 16:31:04 +0100 Subject: [PATCH 05/11] Added install links --- README | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README b/README index 60b15d1..d1ec999 100644 --- a/README +++ b/README @@ -58,8 +58,9 @@ where words with a specific label are hidden. Output can be saved as poster, or run: `make output/reading_structure/index.html` Specific Dependencies: -* nltk: nltk.tokenize.punkt, ne_chunk, pos_tag, word_tokenize, sentiment.vader -* weasyprint -* jinja2 +* nltk (http://www.nltk.org/install.html) +* nltk.tokenize.punkt, ne_chunk, pos_tag, word_tokenize, sentiment.vader (https://www.nltk.org/data.html) +* weasyprint (http://weasyprint.readthedocs.io/en/latest/install.html) +* jinja2 (http://jinja.pocoo.org/docs/2.10/intro/#installation) * font: PT Sans (os font https://www.fontsquirrel.com/fonts/pt-serif) * font: Ubuntu Mono (os font https://www.fontsquirrel.com/fonts/ubuntu-mono) From 8d7fa27c83e06c76af8826149837e73693a3ba3f Mon Sep 17 00:00:00 2001 From: Alice Date: Fri, 23 Mar 2018 16:34:21 +0100 Subject: [PATCH 06/11] Added a save command to overunder to save the pattern to a file --- src/overunder.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/overunder.py b/src/overunder.py index eb06093..09f5b1c 100644 --- a/src/overunder.py +++ b/src/overunder.py @@ -36,6 +36,7 @@ def eval(cmds): global text global line_number global last_index + global pattern for cmd in cmds: if cmd == []: @@ -75,6 +76,11 @@ def eval(cmds): pattern = text[0:line_number + 1] print('\n'.join(pattern)) + elif cmd[0] == 'save': + pattern_file = open('output/patternfile.txt', 'w') + pattern_file.write('\n'.join(pattern)) + pattern_file.close() + print('Your pattern has been saved in the output folder.') elif cmd[0] == 'quit': print('Come back soon!') From 47d33a480d68a4a93e0d86ef5dba5f9247849cc4 Mon Sep 17 00:00:00 2001 From: ange Date: Fri, 23 Mar 2018 16:42:17 +0100 Subject: [PATCH 07/11] Changes in ttssr --- src/ttssr/ttssr-loop-human-only.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ttssr/ttssr-loop-human-only.sh b/src/ttssr/ttssr-loop-human-only.sh index 05ac20b..3e0e8ee 100644 --- a/src/ttssr/ttssr-loop-human-only.sh +++ b/src/ttssr/ttssr-loop-human-only.sh @@ -5,9 +5,9 @@ head -n 1 $1 > output/input0.txt while [[ $i -le 10 ]] do echo $i cat output/input$i.txt - python3 src/ttssr/write_audio.py src/sound$i.wav 2> /dev/null + python3 src/write_audio.py src/sound$i.wav 2> /dev/null play src/sound$i.wav repeat 5 2> /dev/null & #in the background the sound, without it all the sounds play one by one//2 is stderr - python3 src/ttssr/audio_transcribe.py sound$i.wav > output/input$((i+1)).txt 2> /dev/null + python3 src/audio_transcribe.py sound$i.wav > output/input$((i+1)).txt 2> /dev/null sleep 1 (( i++ )) done From 28e30ede1eec6f24fc969c1d5038393cde0a621e Mon Sep 17 00:00:00 2001 From: ange Date: Fri, 23 Mar 2018 16:44:11 +0100 Subject: [PATCH 08/11] Changes in ttssr --- src/{ttssr => }/audio_transcribe.py | 0 src/{ttssr => }/ttssr-loop-human-only.sh | 0 src/{ttssr => }/write_audio.py | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename src/{ttssr => }/audio_transcribe.py (100%) rename src/{ttssr => }/ttssr-loop-human-only.sh (100%) rename src/{ttssr => }/write_audio.py (100%) diff --git a/src/ttssr/audio_transcribe.py b/src/audio_transcribe.py similarity index 100% rename from src/ttssr/audio_transcribe.py rename to src/audio_transcribe.py diff --git a/src/ttssr/ttssr-loop-human-only.sh b/src/ttssr-loop-human-only.sh similarity index 100% rename from src/ttssr/ttssr-loop-human-only.sh rename to src/ttssr-loop-human-only.sh diff --git a/src/ttssr/write_audio.py b/src/write_audio.py similarity index 100% rename from src/ttssr/write_audio.py rename to src/write_audio.py From 8bc38f9ac30f1c93bbc6a235a7f842e53c1f630f Mon Sep 17 00:00:00 2001 From: ange Date: Fri, 23 Mar 2018 16:48:47 +0100 Subject: [PATCH 09/11] Changes in ttssr makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 235edad..a09eb64 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,7 @@ endif ttssr-human-only: ocr/output.txt ## Loop: text to speech-speech recognition. Dependencies: espeak, pocketsphinx - bash src/ttssr/ttssr-loop-human-only.sh ocr/output.txt + bash src/ttssr-loop-human-only.sh ocr/output.txt chatbook: ocr/output.txt #chatbot based on the knowledge of the scans Dependencies: nltk_rake, irc, nltk python3 src/chatbook.py From 38fc0c497b3ae4f1b0ef1eebfe5a22b593868dd0 Mon Sep 17 00:00:00 2001 From: jvdhorst Date: Fri, 23 Mar 2018 16:52:47 +0100 Subject: [PATCH 10/11] Updated make command --- Makefile | 5 +++-- README | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 235edad..d89412a 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ dirs: ## create the dirs in working dir @-mkdir -p output/erase-replace/ @-mkdir -p ocr/ @-mkdir -p hocr/ - @echo $(color_r)'Directories made': ocr/ hocr/ images/ images-tiff/ output/ + @echo $(color_r)'Directories made': ocr/ hocr/ images/ images-tiff/ output/ testif: @@ -72,7 +72,7 @@ hocrs: ## hocr with tesseract and then change extension to .html #OUTPUT GENERATION RECIPES -output/reading_structure/index.html: ocr/output.txt ## Analyzes OCR'ed text using a Part of Speech (POS) tagger. Outputs a string of tags (e.g. nouns, verbs, adjectives, and adverbs). Dependencies: python3's nltk, jinja2, weasyprint +reading_structure: ocr/output.txt ## Analyzes OCR'ed text using a Part of Speech (POS) tagger. Outputs a string of tags (e.g. nouns, verbs, adjectives, and adverbs). Dependencies: python3's nltk, jinja2, weasyprint mkdir -p output/reading_structure cp src/reading_structure/jquery.min.js output/reading_structure cp src/reading_structure/script.js output/reading_structure @@ -80,6 +80,7 @@ output/reading_structure/index.html: ocr/output.txt ## Analyzes OCR'ed text usin cp src/reading_structure/print.css output/reading_structure cat $< | python3 src/reading_structure/reading_structure.py weasyprint -s output/reading_structure/print.css output/reading_structure/index.html output/reading_structure/poster.pdf + x-www-browser output/reading_structure/index.html output/chatbot.txt: ocr/output.txt ## Comments a text with a simple chatbot. Dependencies: python3's chatterbot cat $< | python3 src/textbotconversation.py $(@) diff --git a/README b/README index 75513c1..9e8a3ce 100644 --- a/README +++ b/README @@ -52,18 +52,21 @@ Specific Dependencies: * Speech Recognition: `sudo pip3 install SpeechRecognition` * TermColor: `sudo pip3 install termcolor` -* PyAudio: `pip3 install pyaudio` +* PyAudio: `pip3 install pyaudio` ## Reading the Structure: Joca Description: Uses OCR'ed text as an input, labels each word for Part-of-Speech, stopwords and sentiment. Then it generates a reading interface where words with a specific label are hidden. Output can be saved as poster, or exported as json featuring the full data set. -run: `make output/reading_structure/index.html` +run: `make reading_structure` Specific Dependencies: * nltk (http://www.nltk.org/install.html) -* nltk.tokenize.punkt, ne_chunk, pos_tag, word_tokenize, sentiment.vader (https://www.nltk.org/data.html) +* nltk.tokenize.punkt, ne_chunk, pos_tag, word_tokenize, sentiment.vader +* + nltk.download('vader_lexicon') + (https://www.nltk.org/data.html) * weasyprint (http://weasyprint.readthedocs.io/en/latest/install.html) * jinja2 (http://jinja.pocoo.org/docs/2.10/intro/#installation) * font: PT Sans (os font https://www.fontsquirrel.com/fonts/pt-serif) From cf7697fb0510aafd7f36fde6bcf378901076673d Mon Sep 17 00:00:00 2001 From: Castro0o Date: Fri, 23 Mar 2018 17:04:42 +0100 Subject: [PATCH 11/11] angeliki: dependencies --- README | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README b/README index 75513c1..62e19af 100644 --- a/README +++ b/README @@ -49,7 +49,8 @@ run: `make ttssr-human-only` Specific Dependencies: * PocketSphinx pacakge `sudo aptitude install pocketsphinx pocketsphinx-en-us` - +Python Libaries: +* PocketSphinx: `sudo pip3 install PocketSphinx` * Speech Recognition: `sudo pip3 install SpeechRecognition` * TermColor: `sudo pip3 install termcolor` * PyAudio: `pip3 install pyaudio`