Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我有一个印地语wordnet的数据库和API。我想从NLTK python访问这个wordnet。有没有办法将我们自己的wordnet添加到NLTK中?_Python_Nltk_Wordnet_Hindi_Wsd - Fatal编程技术网

我有一个印地语wordnet的数据库和API。我想从NLTK python访问这个wordnet。有没有办法将我们自己的wordnet添加到NLTK中?

我有一个印地语wordnet的数据库和API。我想从NLTK python访问这个wordnet。有没有办法将我们自己的wordnet添加到NLTK中?,python,nltk,wordnet,hindi,wsd,Python,Nltk,Wordnet,Hindi,Wsd,我有一个印地语wordnet的数据库和API。我想从NLTK python访问这个wordnet,以便在我们的wordnet中使用NLTK wordnet函数。有没有办法将我们自己的wordnet添加到NLTK中? 或 有没有印地语词义消歧工具(可以与任何语言Wordnet一起使用,但需要做一些修改)(这会给Wordnet带来最合适的词义)?如果你查看你的nltk_数据文件夹,你会发现Wordnet和其他nltk语料库一样,只是一堆纯文本文件。因此,必须有一种方法来格式化你的印地语wordnet

我有一个印地语wordnet的数据库和API。我想从NLTK python访问这个wordnet,以便在我们的wordnet中使用NLTK wordnet函数。有没有办法将我们自己的wordnet添加到NLTK中? 或
有没有印地语词义消歧工具(可以与任何语言Wordnet一起使用,但需要做一些修改)(这会给Wordnet带来最合适的词义)?

如果你查看你的nltk_数据文件夹,你会发现Wordnet和其他nltk语料库一样,只是一堆纯文本文件。因此,必须有一种方法来格式化你的印地语wordnet,就像NLTK一样使用函数。以下是nltk.corpus.reader.wordnet对象的摘录,其中读取了这些文件:

#: A list of file identifiers for all the fileids used by this
#: corpus reader.
_FILES = ('cntlist.rev', 'lexnames', 'index.sense',
          'index.adj', 'index.adv', 'index.noun', 'index.verb',
          'data.adj', 'data.adv', 'data.noun', 'data.verb',
          'adj.exc', 'adv.exc', 'noun.exc', 'verb.exc', )

def __init__(self, root):
    """
    Construct a new wordnet corpus reader, with the given root
    directory.
    """
    super(WordNetCorpusReader, self).__init__(root, self._FILES,
                                              encoding=self._ENCODING)
我想您不需要生成所有这些文件,但更重要的是必须使用“index.sense”文件来消除词义歧义。这不是由NLTK生成的,但必须在此之前进行预处理,或者必须以以下格式随印地语wordnet一起提供-

完成所有步骤后,我只需转到../nltk/corpus/reader/wordnet.py,然后创建一个副本,您可以在其中更改根和文件名以及其他一些依赖项,但仍然使用该功能,或者更改现有类中所需的内容(不推荐)


还有一点,谷歌搜索给了我一个指向的链接,这个链接引用了很多关于这个主题的其他来源。

你能给我一个指向印地语wordnet的链接吗?它的文件格式和普林斯顿Wordnet完全一样吗?P.S.不知道为什么投票结果接近。这似乎是一个很好的问题:如何做到这一点很可能是非常重要的,而且对于下一个想要将印地语wordnet与Python结合使用的人来说,答案可能非常有用。