今天在CodeProject找到一位善心人士把Python-Based的ConceptNet API移植到C#平台上,功德無量阿~連結如下:
第一篇單純只是透過C#撰寫的GUI介面去搜尋在本地端下載回來的幾個ConceptNet檔案:
- predicates_concise_kline.txt
- predicates_concise_nonkline.txt
- predicates_nonconcise_kline.txt
- predicates_nonconcise_nonkline.txt
如原始論文所述,ConceptNet中關鍵在於ConceptNet's Relational Ontology,在這個系統中把所有東西的從屬及描述簡化成可以分成8大種類的20種關係。詳細如下:
‧ K-Lines: ConceptuallyRelatedTo, ThematicKLine, SuperThematicKLine
‧ Things(東西): IsA, PartOf, PropertyOf, De.nedAs, MadeOf
‧ Spatial(空間性的): LocationOf
‧ Events(事件): SubeventOf, PrerequisiteEventOf, First-SubeventOf, LastSubeventOf
‧ Causal(因果關係的): EffectOf, DesirousEffectOf
‧ Affective(表達情感的): MotivationOf, DesireOf
‧ Functional(機能/功能性的): CapableOfReceivingAction, UsedFor
‧ Agents(代理/媒介): CapableOf
第一項K-Lines其實就是Knowledge Lines的意思,大概是指對於某些物體或事件的想法或念頭可能集合吧(參考以下說法)
ConceptNet makes it possible, within the limit's of it's knowledgebase, to allow a computer to understand new concepts or even unknown concepts by using conceptual correlations called Knowledge-Lines (K-Lines: a term introduced by Minsky, cf. The Society of Mind (1987)). K-Lines may be thought of a list of previous knowledge about a subject or task.
第二篇的Util主要是做出一個可以做推論系統的介面,但程式執行上目前仍有許多問題。執行這像程式需要:
- Download ConceptNet 2.1.(recommended extraction to ...\My Documents\Python Projects\conceptnet2.1)
- Download Python 2.4 (recommended extraction to C:\Python24)
- Download the latest release IronPython. (recommended extraction to ...\My Documents\Visual Studio 2005\Projects)
- Download and unzip this article's .Net Solution and project files. Open CNUtils2Demo.sln.
- Manually edit the local paths in CNUDB.py (Line 10) and CNUMontylingua.py (Line 8) [files may be found in the Solution Explorer] to point to your conceptnet2.1 and conceptnet2.1\montylingua directories.
- From MS VC# 2005 Solution Explorer, Add a Reference by browsing to IronPython.dll and IronMath.dll located where you extracted the IronPython download.
- ReBuild both projects in the solution. The demo should now be able to execute.
IronPython.dll跟IronMath.dll兩個外掛需要手動載入到VS Studio裡,以及py的目錄也要隨著自己的存放目錄修改。
目前出現的錯誤有ConceptNetUtils.cs:257 lines、ConceptNetUtils.cs:800 lines、Form1.cs:351 Lines。
我在CodeProject上面留言了,改了幾個版本的設定跟路徑似乎也沒有什麼改變。留言如下:
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!!
待後續修改或有善心人士回應吧~
沒有留言:
張貼留言