Неверный ответ от Microsoft Translator API Dictionary Lookup - PullRequest
0 голосов
/ 01 мая 2019

Я использую словарь Microsoft Translator Text API 3.0 в словаре . Он успешно выдает ответ, но некоторые числовые значения неверны . Он отвечает:

confidence: 0.99, numExamples: 0 и frequencyCount: 0

для каждого объекта перевода / обратного перевода. Вот пример того, что я получаю обратно из API:

[
{
"normalizedSource": "yellow",
"displaySource": "yellow",
"translations": [
  {
    "normalizedTarget": "amarillo",
    "displayTarget": "amarillo",
    "posTag": "ADJ",
    "confidence": 0.99,
    "prefixWord": null,
    "backTranslations": [
      {"normalizedText": "gutter","displayText": "gutter","numExamples": 0,"frequencyCount": 0},
      {"normalizedText": "yellow","displayText": "yellow","numExamples": 0,"frequencyCount": 0}
    ]
  },
  {
    "normalizedTarget": "rubio",
    "displayTarget": "rubio",
    "posTag": "ADJ",
    "confidence": 0.99,
    "prefixWord": null,
    "backTranslations": [
      {"normalizedText": "blond","displayText": "blond","numExamples": 0,"frequencyCount": 0},
      {"normalizedText": "fair","displayText": "fair","numExamples": 0,"frequencyCount": 0},
      {"normalizedText": "light haired","displayText": "light haired","numExamples": 0,"frequencyCount": 0},
      {"normalizedText": "light-haired","displayText": "light-haired","numExamples": 0,"frequencyCount": 0},
      {"normalizedText": "sandy","displayText": "sandy","numExamples": 0, "frequencyCount": 0},
      {"normalizedText": "yellow","displayText": "yellow", "numExamples": 0,"frequencyCount": 0}
    ]
  },
  {
    "normalizedTarget": "el amarillo",
    "displayTarget": "el amarillo",
    "posTag": "NOUN",
    "confidence": 0.99,
    "prefixWord": null,
    "backTranslations": [
      {"normalizedText": "yellow","displayText": "yellow", "numExamples": 0,"frequencyCount": 0}
    ]
  },
        // ...list abbreviated

Я использовал службу несколько недель назад (используя точно такой же запрос) и получил правильные результаты, поэтому я не знаю, что изменилось. Правильный ответ выглядит примерно так:

    [
{
    "normalizedSource":"fly",
    "displaySource":"fly",
    "translations":[
        {
            "normalizedTarget":"volar",
            "displayTarget":"volar",
            "posTag":"VERB",
            "confidence":0.4081,
            "prefixWord":"",
            "backTranslations":[
                {"normalizedText":"fly","displayText":"fly","numExamples":15,"frequencyCount":4637},
                {"normalizedText":"flying","displayText":"flying","numExamples":15,"frequencyCount":1365},
                {"normalizedText":"blow","displayText":"blow","numExamples":15,"frequencyCount":503},
                {"normalizedText":"flight","displayText":"flight","numExamples":15,"frequencyCount":135}
            ]
        },
        {
            "normalizedTarget":"mosca",
            "displayTarget":"mosca",
            "posTag":"NOUN",
            "confidence":0.2668,
            "prefixWord":"",
            "backTranslations":[
                {"normalizedText":"fly","displayText":"fly","numExamples":15,"frequencyCount":1697},
                {"normalizedText":"flyweight","displayText":"flyweight","numExamples":0,"frequencyCount":48},
                {"normalizedText":"flies","displayText":"flies","numExamples":9,"frequencyCount":34}
            ]
        },
        // ...list abbreviated
    ]
}
]

Мой запрос URI: 'https://api.cognitive.microsofttranslator.com/dictionary/lookup?api-version=3.0&from=en&to=es'

Могу ли я на самом деле сделать что-нибудь для правильной работы или это проблема с API Microsoft?

...