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

hanlp_nlp can't works,but hanlp can.ES 7.7.0 #155

Open
darkread opened this issue Jun 30, 2024 · 0 comments
Open

hanlp_nlp can't works,but hanlp can.ES 7.7.0 #155

darkread opened this issue Jun 30, 2024 · 0 comments

Comments

@darkread
Copy link

I install the plugin:
bin/elasticsearch-plugin install bin/elasticsearch-plugin install https://github.com/KennFalcon/elasticsearch-analysis-hanlp/releases/download/v7.7.0/elasticsearch-analysis-hanlp-7.7.0.zip

GET _analyze
{
	"tokenizer":"hanlp_nlp",
	"text":"川普说要让美丽国更加伟大"
}

response like this:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "failed to find global tokenizer under [hanlp_nlp]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "failed to find global tokenizer under [hanlp_nlp]"
  },
  "status": 400
}

but hanlp works:

GET _analyze
{
	"tokenizer":"hanlp",
	"text":"川普说要让美丽国更加伟大"
}
{
  "tokens": [
    {
      "token": "川普",
      "start_offset": 0,
      "end_offset": 2,
      "type": "nz",
      "position": 0
    },
    {
      "token": "说",
      "start_offset": 2,
      "end_offset": 3,
      "type": "v",
      "position": 1
    },
    {
      "token": "要",
      "start_offset": 3,
      "end_offset": 4,
      "type": "v",
      "position": 2
    },
    {
      "token": "让",
      "start_offset": 4,
      "end_offset": 5,
      "type": "v",
      "position": 3
    },
    {
      "token": "美丽",
      "start_offset": 5,
      "end_offset": 7,
      "type": "a",
      "position": 4
    },
    {
      "token": "国",
      "start_offset": 7,
      "end_offset": 8,
      "type": "n",
      "position": 5
    },
    {
      "token": "更加",
      "start_offset": 8,
      "end_offset": 10,
      "type": "d",
      "position": 6
    },
    {
      "token": "伟大",
      "start_offset": 10,
      "end_offset": 12,
      "type": "a",
      "position": 7
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant