Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return detailed information of token in konoha API #126

Merged
merged 5 commits into from
Apr 2, 2021
Merged

Conversation

himkt
Copy link
Owner

@himkt himkt commented Apr 1, 2021

This PR modifies the API server to contain rich token information in a response.

Example

% curl localhost:8000/api/v1/tokenize -X POST -H "Content-Type: application/json" -d '{"tokenizer": "sudachi", "text": "自然言語処理", "with_postag": true}'| jq

{
  "tokens": [
    [
      {
        "surface": "自然",
        "postag": "名詞",
        "postag2": "普通名詞",
        "postag3": "一般",
        "postag4": "*",
        "inflection": "*",
        "conjugation": "*",
        "base_form": "自然",
        "yomi": "シゼン",
        "pron": null,
        "normalized_form": "自然"
      },
      {
        "surface": "言語",
        "postag": "名詞",
        "postag2": "普通名詞",
        "postag3": "一般",
        "postag4": "*",
        "inflection": "*",
        "conjugation": "*",
        "base_form": "言語",
        "yomi": "ゲンゴ",
        "pron": null,
        "normalized_form": "言語"
      },
      {
        "surface": "処理",
        "postag": "名詞",
        "postag2": "普通名詞",
        "postag3": "サ変可能",
        "postag4": "*",
        "inflection": "*",
        "conjugation": "*",
        "base_form": "処理",
        "yomi": "ショリ",
        "pron": null,
        "normalized_form": "処理"
      }
    ]
  ]
}

@himkt himkt added the api label Apr 1, 2021
@himkt himkt added this to the v4.6.5 milestone Apr 1, 2021
@himkt himkt merged commit 38261ea into master Apr 2, 2021
@himkt himkt deleted the feature/server branch April 2, 2021 14:18
@himkt himkt self-assigned this Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant