小编ear*_*Lon的帖子

Stanford Parser多线程使用

截至2.0版本(02.03.2012),斯坦福分析师现在是"线程安全的" .我目前正在运行命令行工具,无法通过线程化程序来弄清楚如何利用我的多核.

在过去,这个问题已得到回答,"斯坦福分析师不是线程安全的",正如常见问题解答仍然说的那样.我希望找到一个成功穿越最新版本的人.

我已经尝试使用-t标志(-t10和-tLLP),因为这是我在搜索中找到的所有内容,但两者都抛出错误.

我发出的命令的一个例子是:

java -cp stanford-parser.jar edu.stanford.nlp.parser.lexparser.LexicalizedParser \
-outputFormat "oneline" ./grammar/englishPCFG.ser.gz ./corpus > corpus.lex
Run Code Online (Sandbox Code Playgroud)

multithreading nlp multiprocessing stanford-nlp

8
推荐指数
1
解决办法
3216
查看次数

元素数组中的数组上的MongoDB全文

当元素数组中的数组包含应与我的搜索匹配的文本时,我无法检索文档.

这是两个示例文档:

{
    _id: ...,
    'foo': [
        {
            'name': 'Thing1',
            'data': {
                'text': ['X', 'X']
            }
        },{
            'name': 'Thing2',
            'data': {
                'text': ['X', 'Y']
            }
        }
    ]
}

{
    _id: ...,
    'foo': [
        {
            'name': 'Thing3',
            'data': {
                'text': ['X', 'X']
            }
        },{
            'name': 'Thing4',
            'data': {
                'text': ['X', 'Y']
            }
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

通过使用以下查询,我可以返回两个文档: db.collection.find({'foo.data.text': {'$in': ['Y']}}

但是,我无法使用全文命令/索引返回这些结果: db.collection.runCommand("text", {search" "Y"})

我确信全文搜索工作正常,因为对"Thing1"发出搜索的同一命令将返回第一个文档,"Thing3"返回第二个文档.

我确信foo.data.text和foo.name在使用时都在文本索引中db.collection.getIndexes().

我使用以下方法创建了索引:db.collection.ensureIndex({'foo.name': 'text', 'foo.data.text': 'text'}).以下是上述命令所示的索引:

    {
            "v" : 1,
            "key" : {
                    "_fts" …
Run Code Online (Sandbox Code Playgroud)

full-text-search mongodb pymongo

6
推荐指数
1
解决办法
5843
查看次数