user3673338
user3673338

Reputation: 1

Google Knowledge Graph Search API weird results

I'd like to use this API but my result confuses me.

  1. I want to search for types = "Brand", languages = "en" using search string "Abs" and I got 2 correct and 1 incorrect results, pls. check KG Search API Explorer's response:
{
  "@context": {
    "detailedDescription": "goog:detailedDescription",
    "goog": "http://schema.googleapis.com/",
    "EntitySearchResult": "goog:EntitySearchResult",
    "kg": "http://g.co/kg",
    "resultScore": "goog:resultScore",
    "@vocab": "http://schema.org/"
  },
  "@type": "ItemList",
  "itemListElement": [
    {
      "@type": "EntitySearchResult",
      "resultScore": 296.41555786132812,
      "result": {
        "@id": "kg:/m/01bnqx",
        "@type": [
          "Brand",
          "Thing"
        ],
        "name": "Absolut Vodka",
        "detailedDescription": {
          "license": "https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License",
          "url": "https://en.wikipedia.org/wiki/Absolut_Vodka",
          "articleBody": "Absolut Vodka is a brand of vodka, produced near Åhus, in southern Sweden. Absolut is a part of the French group Pernod Ricard. Pernod Ricard bought Absolut for €5.63 billion in 2008 from the Swedish state. Absolut is one of the largest brands of spirits in the world and is sold in 126 countries.\n"
        },
        "url": "http://www.absolut.com"
      }
    },
    {
      "result": {
        "@id": "kg:/m/04hqw8",
        "name": "Absolute",
        "@type": [
          "Brand",
          "Thing"
        ],
        "detailedDescription": {
          "license": "https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License",
          "articleBody": "Absolute is the brand of a long-running series of compilation albums owned by the Swedish record company EVA Records. Initially, the only albums in the series were called Absolute Music, but starting in 1990 there have been other themed albums such as Absolute Dance and Absolute Rock.",
          "url": "https://en.wikipedia.org/wiki/Absolute_(record_compilation)"
        }
      },
      "resultScore": 103.74134826660161,
      "@type": "EntitySearchResult"
    },
    {
      "@type": "EntitySearchResult",
      "resultScore": 0.0041735083796083927,
      "result": {
        "detailedDescription": {
          "articleBody": "S-AWC is the brand name of an advanced full-time four-wheel drive system developed by Mitsubishi Motors. The technology, specifically developed for the new 2007 Lancer Evolution, the 2010 Outlander, the 2014 Outlander, the Outlander PHEV and the Eclipse Cross have an advanced version of Mitsubishi Motors' AWC system. ",
          "url": "https://en.wikipedia.org/wiki/Mitsubishi_S-AWC",
          "license": "https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License"
        },
        "name": "Mitsubishi S-AWC",
        "@type": [
          "Brand",
          "Thing"
        ],
        "@id": "kg:/m/02vtht5"
      }
    }
  ]
}

where Absolut Vodka and Absolut are good results but I honestly don't understand why "Mitsubishi S-AWC" is listed in this result (with such a low resultScore). Any idea is appreciated :)

  1. I think a feature like a minimum resultScore set in query parameters would be great ! I haven't found such here: Method entities.search

  2. Also, I haven't found an info about what is a minimum character number accepted as a search string ( 2, 3, more? )

Thank you!

Upvotes: 0

Views: 249

Answers (1)

Lockal
Lockal

Reputation: 194

Google Entity Search API outputs results of full-text search over all languages. "languages" parameter does not affect search, it only affects output.

Specifically, you get "Mitsubishi S-AWC" when searching for "ABS", because relevant Chinese article in Chinese Wikipedia contains token ABS in abstract[1].

For example, you can search by "S-AWC is the brand name" in Chinese and get link to Chinese Wikipedia[2], even though Chinese article does not contain these words.

Score here is some kind of BM25 variation[3]. You are free to filter it as you want (e. g. take the first result), but in your example response was correct.

[1] https://zh.wikipedia.org/zh-cn/S-AWC%E8%B6%85%E8%83%BD%E5%85%A8%E6%99%82%E5%9B%9B%E8%BC%AA%E6%8E%A7%E5%88%B6%E7%B3%BB%E7%B5%B1

[2] https://angryloki.github.io/mreid-resolver/#/search?lang=zh&q=S-AWC%20is%20the%20brand%20name&type=Brand

[3] https://en.wikipedia.org/wiki/Okapi_BM25

Upvotes: 0

Related Questions