|
I have posted a video so you may examine the process and how long takes on my laptop.
http://www.youtube.com/watch?v=F6UnuWGkCuk[^]
dorielle wrote: 1. if for example you enter a paragraph and guess mood, how long does it take to give you the feedback?
You can see in the video it took about 2 seconds or so.
dorielle wrote: 2. what are the RPC directed to? will it work without internet connection?
If I remember correctly, in stead of conceptnet being loaded via python it gets loaded in IronPython. It works without internet.
dorielle wrote: 3. can multiple threads use it simultaneously? (say for e.g. can i call guess mood from multiple threads?)
You may be interested in just using Conceptnet nativaly as it can be used as a webservice. I think I even have the webservice running in IronPython once too. The demo has no builtin threading.
|
|
|
|
|
Thank you very much once again for your reply.
1. it takes 10 - 15 seconds for me to give a feedback any ideas on how i can improve this?
2. so again if i have multiple threads processing guess mood, while another thread is accessing the internet, that should relatively be ok right? :/
3. the webservice is faster i guess right? hmm can you direct me to it?
Thank you very much for your assistance!
|
|
|
|
|
dorielle wrote: it takes 10 - 15 seconds for me to give a feedback any ideas on how i can improve this?
Not off the top of my head. The IronPython email lists says there was good performance gains in the newer releases but there is some tweaking of CNU2 that would need to be done.
dorielle wrote: so again if i have multiple threads processing guess mood, while another thread is accessing the internet, that should relatively be ok right? :/
I can't say for certain without trying it myself but it sounds possible.
dorielle wrote: the webservice is faster i guess right? hmm can you direct me to it?
It is built in to ConceptNet 2.1
"If you wish to access ConceptNet from other programming languages such as Java, C++, or the .NET Platform, simply launch ConceptNet's XML-RPC Server (self-documenting) and then interface with ConceptNet via a simple XML-RPC client, which is available for all major programming languages."
http://web.media.mit.edu/~hugo/conceptnet/
and check out http://www.xml-rpc.net/[^]
|
|
|
|
|
thanks again for your reply.. and i apologize for the multiple questions, but now i'm even more confused :/ i checked out that website and it directed me to another which said that XML-RPC calls run over the internet [http://www.xmlrpc.com[^]
so if we're using the ironpython way to access conceptnet from the computer rather than the web.. it's not a webservice, right? :/
again i'm sorry for the multiple questions but u're d only ray of light i have to solve this ..
thanks again
|
|
|
|
|
"XML-RPC is a remote procedure call protocol which uses XML to encode its calls and HTTP as a transport mechanism"
http://en.wikipedia.org/wiki/Xmlrpc[^]
It is generally used over the internet but it is exactly what it is, a remote procedure call protocol. Think of it as server-client, you can have server-client relationhips on the same PC between apps, it doesn't matter.
|
|
|
|
|
aaa ok.. thanks a lot
|
|
|
|
|
Hi,
I am trying to understand how the demo works to then be able to use a similar environment for academic purposes, but I can't get the demo to work.
The error I'm getting is related to the location of conceptnet 2.1 (though I did rename the paths as explained in the steps) am I missing something?
Also, the stack print is specifying that the source of error is at ConceptNetUtils.CNDB.Initialize()
Just to be clear, when you said, rebuild both projects, all I had to do was right click and choose the ReBuild option right?
Thanks a lot
dor
|
|
|
|
|
ok never mind about this.. i restarted everything from scratch and it worked now hehe
|
|
|
|
|
i got the following error message :
"System.ArgumentEception:Illegal charachters in path
at IronPython.modues.PythonNT.Changedirectory(String path)..."
this error is occured in ConecptNetUtils.cs line 259
i followed the instruction step by step and the demo didn't work
and then tried to downgrade form Python 2.5 to 2.4.4 and modify the Paths.cs
i also tried to move both the conceptNet and ironPython to a path that doesn't have spaces ,and i still have the same error message ..
|
|
|
|
|
What version of IronPython are you using?
I last tested with 1.1
Also did you do number step number 5?
I have not tested, and I would have to redesign it to get it to work with 2Beta
|
|
|
|
|
the IronPython version 1.1 ,
but thanx it finally worked !!!
the problem was that the WordNet must be in a path that also doesn't contain "_" nor number
but i think its necessary to modify the "Pathes.cs" to the new path
thanx joeSex
|
|
|
|
|
fadi_mac85 wrote: but thanx it finally worked !!!
the problem was that the WordNet must be in a path that also doesn't contain "_" nor number
Great. Glad to hear.
Not sure if you are interested but since you have WordNet installed you can checkout
http://pswrdgen.googlecode.com/[^]
which also uses WordNet.
|
|
|
|
|
I followed your instructions on setting up your project, and I get an exception on line 6 in CNUMontylingua.py stating "ImportError: No module named MontyTokenizer".
I do have the path to the file in CNUMontylingua.py on line 9:
os.environ['PATH'] = os.environ.get('PATH','')+';C:\Users\WT\Python Projects\External\AI\Language\conceptnet2.1\montylingua;'
If I check that directory, I see these files:
MontyTokenizer.py
MontyTokenizer.pyc
What am I missing?
|
|
|
|
|
Well, one thing I had to do was do two project replaces. That has not fixed the problem, but it's a start.
Replace: "Python24" with "Python25"
Replace: "C:\Python25" with "C:\Program Files\Python25"
|
|
|
|
|
I also had to change the hard-coded paths in Paths.cs lines 44 & 50.
I now get different errors.
"File C:\Program Files\:ython25\Lib\warnings.py, line 264, in Initialize
NameError: name 'ImportWarning' not defined"
If I just click Okay, the form will open, but if I type something in and hit test, I get:
"name 'c' not defined"
at IronPython.Runtime.ModuleScope.GetGlobal(SymbolId symbol)
|
|
|
|
|
Dropping down to version 2.4.4 from 2.5 fixed this error. I'm up and running now!
|
|
|
|
|
JoshMouch wrote: Dropping down to version 2.4.4 from 2.5 fixed this error. I'm up and running now!
Ah good. I have not tested with Python 2.5. I couldn't find any testing info in the ConceptNet documentation about Python 2.5 either.
|
|
|
|
|
Just edit Line 44 and 50 in the Path.cs
|
|
|
|
|
I follow your steps to hard code the line 44 & 50 of path.cs to point to my conceptnet2.1.(CNUMontylingua.py & CNUDB.py path already done.)
And downgrade the Python Version from 2.5 to 2.4.4.
But I still got the same problem, which says:
ImportError:No module named string.
And
IronPython.Runtime.Exception.PythonImportErrorException:Occurred at IronPython.dll
Then I enter a word: "rabbit", error occured at Form1.cs Line 351,says IndexOutOfRangeException. then, the name 'c' not defined error occurred.
Are these errors happened because the path-setting problem? Or something elses I should know first? Many THX!!
|
|
|
|
|
Dear Joe,
When I run the ConceptNet 2.0 client by Python and CNU on .net, I got the different results. For example, for the 'guess mood' functionality, the conceptNet got
angry (41%)
happy (25%)
fearful (17%)
sad (10%)
disgusted (0%)
surprised (0%)
but CNU got
'angry (30%)
happy (30%)
sad (26%)
fearful (21%)
disgusted (0%)
surprised (0%)
meanwhile, some other functions also have a little difference, is there anything wrong with the IronPython library?
Thanks,
Zhi
|
|
|
|
|
woods77 wrote: is there anything wrong with the IronPython library?
Not much, and in my testing the results were the same.
It sounds like you are using different predicate files which would result in different results. The default predicate files are stored in ConceptNet's "ConceptNet.ini" file.
Please let me know if you need more help and I can tell you exactly what is different.
|
|
|
|
|
Zhi,
I retested and it looks like you are correct. I will invest more time to look at it when I get back from vacation.
The only thing that is different from the Python version of ConceptNet is that zlib is not used because IronPython doesn't support it AND I needed to implement my own array module since IronPython doesn't support the array built-in. These two things may be what is causing the different results. I need to have more time to step-thru the guessmood method in Python. I believe I have read about how the guessmood works but I can't remember right now.
Here is the sentence I will be using to test (and my recent results)
"The cat was stuck in the tree."
======
CNU:
(NX The/DT cat/NN NX) (VX was/VBD stuck/VBN VX) in/IN (NX the/DT tree/NN NX)
./.
PC_800149506
<-
in/IN tree/NN
PC_656044526
<-
in/IN the/DT tree/NN
'happy (16%)
fearful (12%)
sad (0%)
angry (0%)
disgusted (0%)
surprised (0%)
'
====
Python:
fearful (17%)
happy (9%)
sad (0%)
angry (0%)
disgusted (0%)
surprised (0%)
-- modified at 1:49 Wednesday 2nd August, 2006
|
|
|
|
|
woods77 wrote: for the 'guess mood' functionality
I may have some light on the answer to your question. The ConceptNetTools.guess_mood method creates a list from the ConceptNetTools.guess_topic method
pairs = self.guess_topic(text,max_results)[1]
The "pairs" List return value is not exactly the same when created in Python and IronPython.
I have not stepped thru guess_topic in Python or IronPython to see exactly why this is so.
I have stepped thru guess_mood and found this first difference. The other difference that I found is that IronPython returns a longer "score" variable. For example, when guess_mood creates the "classes" List, it uses a formula.
classes[i] += sensitivities[i][1]*(score+(a*1.0/max_results))
The formula returns different values in Python and IronPython because
1) the "pairs" List returns different token numbers (which is the "a" variable) depending upon what "word" it found in "naive_ekman". For example, The first "word" found in "naive_ekman" when run using CNU/IronPython is "hate" with a token value held in "a" of '257'. In a Python run, the first "word" found in "naive_ekman" is "sadness" with a token value held in "a" of '98'. "sadness" was found in the CNU/IronPython run but the token number held was higher (I didn't record its exact position). So what has happening is something like:
sad[1] + = (sadness) 1.0 * 0.000740148220089+(98*1.0/1000)
2) IronPython returns a longer "score" value. For example, IronPython uses a "score" of 0.0032130115976214007, while Python uses a value of 0.00321301159762 (this may or may not affect the final calculation).
|
|
|
|
|
Dear Joe,
I've followed the documentation for CNU version 2. Demo works prety fine. Now, I created my own project(since I need to use very limited functionality of CNU) and referenced:
1. ConceptNetUtils2 Project (added in the same namaspace)
2. IronMath.dll and IronPython.dll (added references in project)
3. ConceptNetUtils2.dll (added reference in project)
4. Changed paths in CNUDB.py and CNUMontyLingua.py
Now if I run the project, it gives an error:
IronPython.Runtime.Exceptions.PythonImportErrorException: No Module named CNUDB
Exception is thrown from ConceptNetUtil.cs file on the line
cn_pe.Execute("import CNUDB");
Am I missing something? Please reply
Mansi
|
|
|
|
|
mansidshah wrote: Now if I run the project, it gives an error:
IronPython.Runtime.Exceptions.PythonImportErrorException: No Module named CNUDB
It sounds like CNUDB.py and the rest of the supporting script files with ConceptNetUtils2.dll are not in the same directory as ConceptNetUtils2.dll.
Is this correct? array.py, CNUDB.py, CNUMontyCommonsense.py, CNUMontyLexiconCustom.py, CNUMontyLexiconFast.py, CNUMontylingua.py, CNUMontyNLGenerator.py, CNUMontyTagger, and CNUTools.py must be in the same folder as ConceptNetUtils2.dll because IronPython does not support embedded files. Please let me know if this helps.
|
|
|
|