以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 Web Services & Semantic Web Services 』  (http://bbs.xml.org.cn/list.asp?boardid=10)
----  [求助]关于wordnet  (http://bbs.xml.org.cn/dispbbs.asp?boardid=10&rootid=&id=54630)


--  作者:chenmon
--  发布时间:10/30/2007 10:21:00 AM

--  [求助]关于wordnet
现在在做一个研究,就是怎么计算出两个概念间语义的集合关系(属于,相等,相离),不知道大家有没有什么好的建议和想法
   我是想利用wordnet来做,因为之前看了两篇相关的文章,他们就是用wordnet来做的,我从网络上下了一个wordnet2。1,是一个小的界面,有点象金山词霸那样的,然后我开始用不同的概念来做试验,就是来查那个字典,比较两个概念
   于是我就非常困惑,如果利用wordnet来比较概念,不可能是人工一个个去查吧,是怎么自动实现的呢?可以写代码吗?我下的那个wordnet2.1,就是一个供输入要查询单词的界面,没有复杂的可以输入代码的地方啊。。。。。。不知道哪位高手可以给我点拨!!
   谢谢了!!

  刚才在论坛里浏览了一下,有这样一个帖子:
“如何度量两个概念之间的语义距离。语义距离越近,就表明两个概念越相似。这样在工程实现上就可以用于有关“可能替代品“的推理。许多人现在使用的是计算语言学上的方法, 特别是用WordNet的办法来度量两个概念的语义距离。”


  问题是,怎么算??可能是我下的那个wordnet只是一个小试验的版本,不是正式的??要利用的话不会是一个个人工去查词吧,郁闷


--  作者:chenmon
--  发布时间:10/30/2007 10:34:00 PM

--  
自己顶起来
--  作者:zhaonix
--  发布时间:10/31/2007 10:27:00 AM

--  
不太能看懂楼主的问题。不过如果是在问WordNet有没有API的话,答案是有的,各种编程语言的都有,记得在WordNet主页上某个地方列了出来。Java的有两个:JWNL和JWordNet,似乎都在sourceforge上可以下载,其中有一个是几年前开发的好几年没维护过了。
--  作者:chenmon
--  发布时间:10/31/2007 3:00:00 PM

--  
以下是引用zhaonix在2007-10-31 10:27:00的发言:
不太能看懂楼主的问题。不过如果是在问WordNet有没有API的话,答案是有的,各种编程语言的都有,记得在WordNet主页上某个地方列了出来。Java的有两个:JWNL和JWordNet,似乎都在sourceforge上可以下载,其中有一个是几年前开发的好几年没维护过了。


  呵呵,谢谢你
  简单来说就是怎么利用wordnet来编程实现词的匹配之类的
  我现在用wordnet就是当金山词霸那样,在界面上输入一个词,然后可以查这个词的同义词啦,hyponyms,meronyms啦等等
  我不知道要怎么使用wordnet..............
--  作者:chenmon
--  发布时间:11/2/2007 9:43:00 AM

--  [求助]这个错误是怎么回事
现在我能用jwnl里面的那个example.java的例子了,就是编译能通过,但是我不知道该怎么用它啊!!!
  如果直接运行的话,那么按程序上说的,直接显示出:java examples <properties file>
如果我输入一个参数变量去运行,则提示错误
   java.io.FileNotFoundException: art (系统找不到指定的文件。)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at Examples.main(Examples.java:39)

   上面的那个art是我输入的,我想看看这个例子到底是干吗的,结果就出这个错了
  哪位高手能不吝赐教?


--  作者:bzbc
--  发布时间:11/2/2007 11:03:00 AM

--  
请把程序贴出来,好吗?
--  作者:chenmon
--  发布时间:11/2/2007 12:37:00 PM

--  [讨论]最新进展
自己又捣鼓了一上午
发现在doc.zip里有三个属性配置文件,其中有一个是file_properties.xml,在里面有这样一行文字:<param name="dictionary_path" value="c:\program files\wordnet\2.0\dict"> 原来这里需要配置,因为我的wordnet是安装在别的路径下,于是把路径改了

再运行example.java,注意:其中要输入的命令行参数是file_properties.xml(其实我不知道是不是要输入这个)
  然后就运行了,起码没有错误提示,运行的结果很多,我摘录一部分:
    [PointerTargetTreeNode: [Synset: [Offset: 2029916] [POS: noun] Words: toy_poodle -- (the smallest poodle)] [PointerType: [Label: hyponym] [Key: ~] Applies To: noun, verb] [Has Parent? false] [Has Children? false] [Has Pointers? false]]
    [PointerTargetTreeNode: [Synset: [Offset: 2029992] [POS: noun] Words: miniature_poodle -- (a small poodle)] [PointerType: [Label: hyponym] [Key: ~] Applies To: noun, verb] [Has Parent? false] [Has Children? false] [Has Pointers? false]]
    [PointerTargetTreeNode: [Synset: [Offset: 2030069] [POS: noun] Words: standard_poodle -- (a medium-sized poodle)] [PointerType: [Label: hyponym] [Key: ~] Applies To: noun, verb] [Has Parent? false] [Has Children? false] [Has Pointers? false]]
    [PointerTargetTreeNode: [Synset: [Offset: 2030152] [POS: noun] Words: large_poodle -- (the largest poodle)] [PointerType: [Label: hyponym] [Key: ~] Applies To: noun, verb] [Has Parent? false] [Has Children? false] [Has Pointers? false]]
  [PointerTargetTreeNode: [Synset: [Offset: 2030229] [POS: noun] Words: Mexican_hairless -- (any of an old breed of small nearly hairless dogs of Mexico)] [PointerType: [Label: hyponym] [Key: ~] Applies To: noun, verb] [Has Parent? true] [Has Children? false] [Has Pointers? false]]
Hypernym relationship between "dog" and "cat":
  [PointerTargetNode: [Synset: [Offset: 2001223] [POS: noun] Words: dog, domestic_dog, Canis_familiaris -- (a member of the genus Canis (probably descended from the common wolf) that has been domesticated by man since prehistoric times; occurs in many breeds; "the dog barked all night")] [PointerType: [Label: hypernym] [Key: @] Applies To: noun, verb]]
  [PointerTargetNode: [Synset: [Offset: 2000516] [POS: noun] Words: canine, canid -- (any of various fissiped mammals with nonretractile claws and typically long muzzles)] [PointerType: [Label: hypernym] [Key: @] Applies To: noun, verb]]
  [PointerTargetNode: [Synset: [Offset: 1992546] [POS: noun] Words: carnivore -- (terrestrial or aquatic flesh-eating mammal; terrestrial carnivores have four or five clawed digits on each limb)] [PointerType: [Label: hyponym] [Key: ~] Applies To: noun, verb]]
  [PointerTargetNode: [Synset: [Offset: 2037116] [POS: noun] Words: feline, felid -- (any of various lithe-bodied round-headed fissiped mammals many with retractile claws)] [PointerType: [Label: hyponym] [Key: ~] Applies To: noun, verb]]
  [PointerTargetNode: [Synset: [Offset: 2037721] [POS: noun] Words: cat, true_cat -- (feline mammal usually having thick soft fur and being unable to roar; domestic cats; wildcats)] [PointerType: [Label: hyponym] [Key: ~] Applies To: noun, verb]]
Common Parent Index: 2
Depth: 4
Synonym relationship between "funny" and "droll":
  [PointerTargetNode: [Synset: [Offset: 1219207] [POS: adjective] Words: humorous, humourous -- (full of or characterized by humor; "humorous stories"; "humorous cartoons"; "in a humorous vein")] [PointerType: [Label: similar] [Key: &] Applies To: adjective]]
  [PointerTargetNode: [Synset: [Offset: 1220448] [POS: adjective] Words: droll -- (comical in an odd or whimsical manner; "a droll little man with a quiet tongue-in-cheek kind of humor")] [PointerType: [Label: similar] [Key: &] Applies To: adjective]]
Depth: 1


--  作者:chenmon
--  发布时间:11/2/2007 12:39:00 PM

--  
希望我的经历会给大家带来帮助
  我还有许多地方没有搞懂,比如说,怎么使用这个jwnl,起码我想我输入两个词,然后能输出他们这两个词在字典里的语义关系
  还有,jwnl这个自带的example例子是干什么用的??
我会把学习新的写出来供大家学习交流
  也希望高手们能不吝赐教!!谢谢了
--  作者:zhaonix
--  发布时间:11/2/2007 2:32:00 PM

--  
以下是引用chenmon在2007-11-2 12:39:00的发言:
希望我的经历会给大家带来帮助
   我还有许多地方没有搞懂,比如说,怎么使用这个jwnl,起码我想我输入两个词,然后能输出他们这两个词在字典里的语义关系
   还有,jwnl这个自带的example例子是干什么用的??
  我会把学习新的写出来供大家学习交流
   也希望高手们能不吝赐教!!谢谢了


赞楼主!
其实前面那个问题、你现在问的这个问题(这个例子干什么用)都是很普通的问题,只要自己看例子代码时细心一点,都是可以搞定的。
P.S. to 楼主: 中午登录上来只看了邮箱、没看这个帖子,没想到给你回信说的原来你在上午已经解决了,不要奇怪、见怪!
--  作者:chenmon
--  发布时间:11/3/2007 3:06:00 PM

--  怎么求两个词是否是属于关系
example的例子大概是看懂了,go方法里面的5个方法各有各的用处
但没有一个是求两个词是否是属于关系的

有没有这样的方法呢???

想查看jwnl里面各个方法的意思,在哪里可以看到呀????


--  作者:chenmon
--  发布时间:11/3/2007 4:22:00 PM

--  
找到jwnl的类库了,可以查找所有的类和所有的方法,但是,三个字:太多了...............
  
 想写个程序,判断概念间是否是属于的关系
 即能判断art#1属于humanities#1 这样的
 要用什么方法啊
--  作者:zhaonix
--  发布时间:11/3/2007 5:09:00 PM

--  
不知道你说的“属于”关系是什么意思。    如果是 子类 、继承 这种意思的话,这是WordNet的价值所在,JWNL一定是有办法查的。  你再去看看那个例子去,里面的getDirectHypernyms()和 getHyponymTree()就是干这个的。
    如果你还不清楚,我再说一下WordNet的一点基本知识:每个单词(Word)有多个Synset(义项),每个Synset可能包含一个或多个Word。 Synset之间存在继承关系,一个Synset的上位节点(即父节点,可能有多个)叫hypernym;下位节点(即子节点,可能有多个)叫hyponym。

另外,兄弟,你发帖的风格该改改吧:写了那么多标点、却不写清楚问题。一个类库有一大堆类这有什么好奇怪的。别人想帮你都不知道该怎么帮你。
    最重要的:以后问问题之前能不能自己先把自己可以做的工作做足? 老问这种基本的、看文档和例子代码就很容易弄清楚的问题,这可不是一个好习惯! ——你以为别人有多少时间等着回答你的问题呢?

[此贴子已经被作者于2007-11-5 20:53:17编辑过]

--  作者:chenmon
--  发布时间:11/4/2007 6:36:00 PM

--  
你说的synset就是每个单词的sense吧,上位,下位的关系我也明白,如果查dog,一个是...is kind of dog(hyponym),另一个是 dog is a kind of ...(hypernym)
  我说的属于就是 is_a 的关系,如 DOG is_a animal,即dog 属于 animal,也就是在语义关系上 dog is less than animal,或者animal is more than dog
--  作者:tju_miaomiao
--  发布时间:4/2/2009 3:45:00 PM

--  
小妹也正在搞这方面的研究。。感觉有点摸不着头脑。。
--  作者:zhoulian123
--  发布时间:5/19/2009 3:15:00 PM

--  
jwnl中有一例子是AntonymRelationshipTest,是得出两个概念之间的关系,但我在运行之后得出的不知道是什么?有哪位大侠知道,麻烦指点一下!
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
87.891ms