2

我正在尝试使用短语建议器创建你的意思功能。当我将文本提供给术语建议者并按分数对结果进行排序时,我会在基于术语的建议的顶部获得最想要的结果。但是结合这些单独的结果对我来说似乎毫无意义,因为我们有短语建议。但是,当我尝试使用与我之前的术语建议器相同的参数的短语建议器时,我没有得到想要的结果。

"my-title-suggestions-3": [
     {
        "text": "devloping",
        "offset": 0,
        "length": 9,
        "options": [
           {
              "text": "developing",
              "score": 0.8888889,
              "freq": 340
           },
           {
              "text": "deploying",
              "score": 0.7777778,
              "freq": 24
           },
           {
              "text": "devoting",
              "score": 0.75,
              "freq": 3
           }
        ]
     },
     {
        "text": "distibutd",
        "offset": 10,
        "length": 9,
        "options": [
           {
              "text": "distributed",
              "score": 0.7777778,
              "freq": 32
           },
           {
              "text": "distribute",
              "score": 0.7777778,
              "freq": 31
           }
        ]
     },
     {
        "text": "saerch",
        "offset": 20,
        "length": 6,
        "options": [
           {
              "text": "search",
              "score": 0.8333333,
              "freq": 367
           },
           {
              "text": "speech",
              "score": 0.6666666,
              "freq": 54
           },
           {
              "text": "sketch",
              "score": 0.6666666,
              "freq": 11
           }
        ]
     },
     {
        "text": "engies",
        "offset": 27,
        "length": 6,
        "options": [
           {
              "text": "engines",
              "score": 0.8333333,
              "freq": 80
           },
           {
              "text": "engine",
              "score": 0.6666666,
              "freq": 217
           },
           {
              "text": "entries",
              "score": 0.6666666,
              "freq": 15
           }
        ]
     }
  ]

上面显示了从术语建议者那里获得的术语频率和分数。

以下是我从第一句话中得到的:

   "suggest": {
  "simple_phrase": [
     {
        "text": "devloping distibutd saerch engies",
        "offset": 0,
        "length": 33,
        "options": [
           {
              "text": "developing distributed search engine",
              "highlighted": "<em>developing distributed search engine</em>",
              "score": 8.401011e-8
           },
           {
              "text": "developing distribute search engine",
              "highlighted": "<em>developing distribute search engine</em>",
              "score": 6.85284e-8
           },
           {
              "text": "developing distributed search engines",
              "highlighted": "<em>developing distributed search engines</em>",
              "score": 5.546362e-8
           },
           {
              "text": "developing distribute search engines",
              "highlighted": "<em>developing distribute search engines</em>",
              "score": 5.2338663e-8
           },
           {
              "text": "developing distributed speech engine",
              "highlighted": "<em>developing distributed speech engine</em>",
              "score": 3.586202e-8
           }
        ]
     }
  ]

短语建议者似乎使用术语频率来组合来自直接建议者的内容。但是,正如您在上面看到的,这不是想要的结果,在这种情况下,真正好的建议会排在第三位。有没有办法改变这种行为并将基于术语的建议结合在短语建议器中的分数?

4

0 回答 0