jbrew / pt-voicebox Goto Github PK
View Code? Open in Web Editor NEWpredictive text interface
License: MIT License
predictive text interface
License: MIT License
I previously got this to work on Windows 8.1, but had to factory reset my laptop and now can't remember how I did it, whoops. I'm very, very new to programming.
I installed Python 2.7, downloaded and extracted pt-voicebox, and added Python to my environment variables. Then I tried to run the predictive text program through the command prompt.
When I change the directory to the folder where voicebox.py is located, and try to run it with "python voicebox.py", I've been getting the following:
"Traceback :
File voicebox.py, line 14, in
from .corpus import Corpus
Value Error: Attempted relative import in non-package"
Does anyone know what I'm possibly doing wrong? Thanks in advance~
Hi! I don't know much about Terminal or coding, so this might be a dumb question.
When I follow step 5 of "Running the Program" (by entering "pip install -r requirements.txt" in terminal from the pt-voicebox folder, I get the error message "command not found". Do I need to install something else to enable that command?
There are multiple .py files, which one to open/run in python? Generally this is written in the readme but not in this case.
A little help? How do I use this
I noticed one of your example generations was an X-Files conversation between Mulder and Scully, with directions. I at first assumed you had created voice files for each character, but then I saw the raw transcripts folder which contained a full x-files transcript. Did you generate it from this? If so, how?
I'm following the instructions in 'Getting Started (Mac OS X)'. After step 7 (bin/voicebox
) i'm getting an error. Code from my Terminal looks like this:
Fullname:pt-voicebox Fullname$ bin/voicebox
Traceback (most recent call last):
File "bin/voicebox", line 8, in <module>
import voicebox
File "/Users/Fullname/Desktop/pt-voicebox/voicebox/__init__.py", line 3, in <module>
from .voicebox import Voicebox
File "/Users/Fullname/Desktop/pt-voicebox/voicebox/voicebox.py", line 16, in <module>
from .pickler import loadobject, save_object
File "/Users/Fullname/Desktop/pt-voicebox/voicebox/pickler.py", line 4, in <module>
import six.moves.cPickle as pickle
ImportError: No module named cPickle
This is a cool project :) It's big enough to do something interesting but small enough that I can wrap my head around most of it.
As it stands, Voicebox is both the editor UI and predictive text generator. I'd like to separate them so that perhaps additional frontends could be developed. Also, this should help with testability.
Opening an issue to discuss, since it would be a somewhat radical refactoring of Voicebox. @jbrew do you have any opposition to me attempting this split? I'm thinking I'll turn Voicebox into the owner of generator state and add a new editor module.
I'm using a corpus slurped from Twitter by a Node script. Sometimes just after adding a word I get this error:
Traceback (most recent call last):
File "bin/voicebox", line 11, in <module>
vb.write()
File "/Users/sugarbaker/Documents/sen_markov/pt-voicebox/voicebox/voicebox.py", line 100, in wr
ite
self.display_suggestions(suggestions)
File "/Users/sugarbaker/Documents/sen_markov/pt-voicebox/voicebox/voicebox.py", line 359, in di
splay_suggestions
info_string = "%s: %s" % (i + 1, str(suggestions[i][0]))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 3: ordinal not in
range(128)
I haven't checked to see what that character is... this should be fun, hang on.
...it's an ellipsis.
Oh god I just saw what I did there. But, okay.
Hi Can you tell me how does it work as I opened the voicebox.py file in Powershell
Afterwards following the onscreen instructions
Load previous session? y/n
n
1 .git
2 .gitattributes
3 .gitignore
4 batman
5 bourdain
6 bowie
7 howl
8 library_of_babel
9 poorrichard
Enter the number of the corpus you want to load:
9
Enter the weight for poorrichard:
1
Add another corpus to this voice? y/n
n
Name this voice:
Me
Add more? y/n
n
VOICES:
1: Me
Choose a voice to write with...
File "voicebox.py", line 408, in
main()
File "voicebox.py", line 405, in main
vb = Voicebox()
File "voicebox.py", line 71, in init
self.active_voice = self.choose_voice()
File "voicebox.py", line 353, in choose_voice
self.active_voice = self.voices[voice_keys[int(choice) - 1]]
IndexError: list index out of range
I get stuck at this last command as it gives me an error every time. It will be great if you can explain the inputs for the commands !! Since I am new to understanding this. Would really appreciate the effort from you end to make a novice like me little more aware.
Error I'm getting:
Traceback (most recent call last):
File "bin/voicebox", line 10, in
vb = voicebox.Voicebox()
File "/Users/fullname/code/pt-voicebox/voicebox/voicebox.py", line 69, in init
self.load_voices()
File "/Users/fullname/code/pt-voicebox/voicebox/voicebox.py", line 291, in load_voices
self.add_voice()
File "/Users/fullname/code/pt-voicebox/voicebox/voicebox.py", line 309, in add_voice
new_voice.add_corpus(Corpus(text, corpus_name), corpus_weight)
File "/Users/fullname/code/pt-voicebox/voicebox/corpus.py", line 31, in init
self.make_tree()
File "/Users/fullname/code/pt-voicebox/voicebox/corpus.py", line 50, in make_tree
sentences = self.get_sentences()
File "/Users/fullname/code/pt-voicebox/voicebox/corpus.py", line 100, in get_sentences
) for sentence in sentences if sentence]
File "/Users/fullname/code/pt-voicebox/voicebox/corpus.py", line 100, in
) for sentence in sentences if sentence]
AttributeError: 'str' object has no attribute 'decode'
I'm using Python 3.5 - I think the problem is that the string in question is already decoded automatically by this point?
This is a very cool idea but I'm wondering on how you're implementing your markovesque algo
If i understood correctly each word has a dictionary of next word and each next word another dictionary and thats it because you don't want nesting too much to not blow up too much memory.
But with instead of storing, in the dictionary, the word, you're storing a reference to it ? First you create an object for all words and then you start over and process each word adding in their "next word dictionary" only a ref to the "word object" that was created. You could have very long recursion with it being very lightweight.
I don't know if I make sense ?
Using Python 3.6.0 and nose 1.3.7:
$ bin/voicebox
Load previous session? y/n
y
1 howl_richard.pkl
Enter the number of the session you want to load:
1
Traceback (most recent call last):
File "bin/voicebox", line 10, in <module>
vb = voicebox.Voicebox()
File "/home/seb/tmp/pt-voicebox/voicebox/voicebox.py", line 59, in __init__
loaded_voicebox = self.load_session() # unpickles a previously-saved object
File "/home/seb/tmp/pt-voicebox/voicebox/voicebox.py", line 228, in load_session
return loadobject(path)
File "/home/seb/tmp/pt-voicebox/voicebox/pickler.py", line 15, in loadobject
obj = pickle.load(input)
AttributeError: Can't get attribute 'Voicebox' on <module '__main__' from 'bin/voicebox'>
I was wondering how I could get this to work on Windows, if it's possible. Is there a way I can run it?
I am completely new to programing and I heard about this predictive text generator and really wanted to try it. Help please?
Hello,
I forked a few days ago, and I'm having problems running the voicebox.py file. The error message is "Syntax Error: invalid syntax" on line 95 - "print self.header()". Do you have an idea of what may be the cause of this?
I'm running Python 3.5.1 :: Anaconda 2.4.1 (x86_64) on MacBook Pro / Os X El Capitan.
any help you can provide would be appreciated?
thank you!
v/r
Neill
Novice here. Keep getting the following error, every time I try "writing" with this I can get a little bit further along but invariably end up with this error and no obvious (to me) way of starting back on the source. Hope you can help (please be detailed as I'm a total novice)
Traceback (most recent call last):
File "bin/voicebox", line 11, in
vb.write()
File "/Users/dmitrizurita/Desktop/pt-voicebox-master/voicebox/voicebox.py", line 100, in write
self.display_suggestions(suggestions)
File "/Users/dmitrizurita/Desktop/pt-voicebox-master/voicebox/voicebox.py", line 359, in display_suggestions
info_string = "%s: %s" % (i + 1, str(suggestions[i][0]))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2014' in position 1: ordinal not in range(128)
I'm using the previous commit in the meantime, since it's rendered the current one useless.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.