spacy

    2热度

    3回答

    输入文本三克总是在有1〜3个形容词和名词 输入 thai iced tea spicy fried chicken sweet chili pork thai chicken curry 输出盘名的列表: thai tea, iced tea spicy chicken, fried chicken sweet pork, chili pork thai chicken, chic

    2热度

    2回答

    因此,无论何时我尝试加载先前保存的SpaCy NER模型,我都会得到一个核心转储。 if os.path.isfile(model_path): ner.model.load(model_path) for itn in range(5): random.shuffle(TRAIN_DATA) for raw_text, entity_offsets in TRAI

    0热度

    1回答

    我正在尝试将库存符号添加到识别为ORG实体的字符串中。对于每一个符号,我做的: nlp.matcher.add(symbol, u'ORG', {}, [[{u'orth': symbol}]]) 我可以看到这个符号被添加到模式: print "Patterns:", nlp.matcher._patterns 但不加确认之前的任何符号添加后不能识别。显然,这些令牌已经存在于词汇表中(这就

    3热度

    1回答

    我正在使用Spacy,它是一个Python自然语言处理库,将原始文本解析为更复杂的面向对象格式,更具体地说是依赖关系树。 上述操作需要一段时间才能执行:我需要加载一个非常昂贵的模型,然后解析大量的文本。我希望在后续执行中节省一些时间,以便在完成此初始分析后更快地处理数据。 如何在第一次运行后“保存”这些结果,然后在后续运行中更快地重新加载这些预处理版本? PICKLE:当试图使用泡菜我得到以下错误

    0热度

    1回答

    我有以下代码打开目录中的文件,对它们运行spaCy NLP,输出依赖项将信息解析到新目录中的文件中。 import spacy, os nlp = spacy.load('en') path1 = 'C:/Path/to/my/input' path2 = '../output' for file in os.listdir(path1): with open(file, e

    4热度

    1回答

    我试图从下面的段落结构提取这种类型的信息: women_ran men_ran kids_ran walked 1 2 1 3 2 4 3 1 3 6 5 2 text = ["On Tuesday, one women ran on the street while 2 men ran and 1 child ran on the sid

    3热度

    1回答

    from spacy.en import English from numpy import dot from numpy.linalg import norm parser = English() # you can access known words from the parser's vocabulary nasa = parser.vocab['NASA'] # cos

    0热度

    1回答

    我正在尝试使用Spacy.io自定义管道进行语言处理,但似乎在向流水线添加自定义函数时,该进程只在一个线程上运行。使用默认管道进程使用指定的所有线程。 这是我如何定义的管道: nlp = spacy.load(language, create_pipeline=custom_pipeline) 这是custom_pipeline功能: def custom_pipeline(nlp):

    6热度

    2回答

    我正在努力研究一个句子中的主题提取问题,以便我可以根据主题获得情感。我在python2.7中使用nltk来达到这个目的。以下面的句子为例: Donald Trump is the worst president of USA, but Hillary is better than him 他我们可以看到,Donald Trump和Hillary是两个科目,有关Donald Trump情绪是负的,但

    0热度

    1回答

    我试图在python 3的anaconda环境中使用Windows 8安装spaCy。遵循spaCy网站上的说明,我运行以下命令。 $ pip install spacy $ python -m spacy.en.download 第一个命令的工作看起来很好。然而,第二个命令将导致错误: urllib.error.URLError: 完整回溯: Traceback (most recent