natural language parsing / data visualization

hi

i’ve done some data visualization concerning natural language parsing
with the stanford language parser using swing ( java )
http://nlp.stanford.edu/software/lex-parser.shtml

now i would like to take that into blender :slight_smile:

for python
the following package comes to mind
the natural language toolkit
http://nltk.org/

but i’m having problems using the package in blender

anybody has any ideas or thoughts on how to import the package into blender ?

thanks for any info
regards
sc3

Install the package for the python version used in blender (3.2). Then copy the package from e.g. C:\Python32\Lib\site-packages to
C:\Program Files\Blender Foundation\Blender\2.64\scripts\modules. (You may need to install python 3.2 first)
OR
Get the package compiled for your system from somewhere and copy it to …\scripts\modules
Now you can import nltk in every script.

@Afeitadora

thanks for your answer
i will try that if i get that far

problem is that nltk is not really python 3 ready yet
, they’re in the process of porting it
there is an experimental branch

it’s a bit of a mess
blender now uses python3.3

i cannot install nltk with python3.3
but i can with python3.2

then copied the installed directories to the blender ‘modules’ directory as you said

i can already to the following:
import nltk
sentence = ‘this is a sentence’
tokens = nltk.word_tokenize(sentence)
print(tokens)

this is great :slight_smile:
but the following

tagged = nltk.pos_tag(tokens)
print(tagged)

complains about “ImportError: No module named ‘numpy’”

i remember much ado about including numpy or not into blender

how can i install numpy for blender ?

thanks
regards
sc3

Apparently too many people complained so numpy doesn’t get bundled by default, you have to install it however you install other python modules and/or mess with sys.path to get python to see it.

i give up on importing nltk into blender

it is really not ready for python3

thanks for your responses

Just do it exactly the same way you did with nltk.
At http://www.lfd.uci.edu/~gohlke/pythonlibs/ you can find numpy builds for python 3.2.
For e.g. Win7,64bit choose numpy-unoptimized-1.6.2.win-amd64-py3.2.*exe