pomohl by mi tady nekdo ten skript zprovoznit?...potreboval bych to udelat a nejak mi to nejde...klidne nekomu zaplatim za cas..nabidne se nekdo?
Příspěvky odeslané z IP adresy 213.146.254.–
zkopiroval jsem estimator a spustil script, haze mi to ted mnoho chyb typu:
Warning (from warnings module):
File "C:\Python27\lib\site-packages\nltk\probability.py", line 598
" is returning an arbitrary sample." % (self, 1-p))
UserWarning: Probability distribution <SimpleGoodTuringProbDist based on 1 samples> sums to 0.530362071609097; generate() is returning an arbitrary sample.
dale mam dotaz, kam mam ulozit soubor "english-kjv.txt", protoze mi script tento soubor nenacita a vyhodi mi to nejaky text z bible :-)
zdravim...
tak jsem to spustil bez tech mezer :-)...ale ted mi to hazi dalsi chybu:
Traceback (most recent call last):
File "C:/Python27/fuck2", line 12, in <module>
model = NgramModel(3, tokens,estimator)
NameError: name 'estimator' is not defined
from nltk.corpus import reuters
from nltk.corpus import genesis
from nltk.probability import LidstoneProbDist
from nltk.model import NgramModel
tokens = list(genesis.words('english-kjv.txt'))
tokens.extend(list(reuters.words(categories = 'trade')))
model = NgramModel(3, tokens,estimator)
text_words = model.generate(50)
text = ' '.join([word for word in text_words])
print text
zdravim,
na odkazu http://nlpb.blogspot.de/2011/01/experiments-with-statistical-language.html bych rad spustil program, ktery tam je napsany. Nainstaloval jsem si do pc NLTK ale, kdyz program spustim, tak mi to haze chybu:
unexpended indent.
asi se mi nenaimportuje z NLTK knihovny...:
nevite co muzu delat spatne? s Pythonem teprve zacinam a potrebuji, aby mi tento program fungoval.
diky