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

Elasticsearch error in allenNLP-NER #1

Open
midannii opened this issue Mar 22, 2023 · 0 comments
Open

Elasticsearch error in allenNLP-NER #1

midannii opened this issue Mar 22, 2023 · 0 comments

Comments

@midannii
Copy link

Hi.

When I try to run below code in allenNLP-NER after run elastic_search server in localhost:9200

python nel.py  \
   -data_path "data_path/" \
  -save_path "tag_data_ner" \
  -file_path "trainlist.txt" \
  -dataset 'train' \
  -start 0  \
  -end -1 

I found the error below for every file in trainlist.txt

Failed  KGQA/SPICE/SPICE_release/train/QA_1023/QA_0.json
File KGQA/SPICE/SPICE_release/train/QA_1023/QA_42.json.tagged will be processed ... 
Traceback (most recent call last):
  File "KGQA/SPICE/dataset/ner/allennlp_ner/nel.py", line 69, in add_nel_file
    return _add_nel_file(data_file,outfile, predictor_elmo)
  File "KGQA/SPICE/dataset/ner/allennlp_ner/nel.py", line 108, in _add_nel_file
    r=elasticsearch_query(query=w, res_size=5)
  File "KGQA/SPICE/dataset/ner/allennlp_ner/nel.py", line 56, in elasticsearch_query
    res = elastic_search.search(index='csqa_wikidata', doc_type='entities',
  File "/home/anaconda3/envs/SPICE/lib/python3.9/site-packages/elasticsearch/client/utils.py", line 139, in _wrapped
    return func(*args, params=params, headers=headers, **kwargs)
  File "/home/anaconda3/envs/SPICE/lib/python3.9/site-packages/elasticsearch/client/__init__.py", line 1479, in search
    return self.transport.perform_request(
  File "/home/anaconda3/envs/SPICE/lib/python3.9/site-packages/elasticsearch/transport.py", line 345, in perform_request
    status, headers_response, data = connection.perform_request(
  File "/home/anaconda3/envs/SPICE/lib/python3.9/site-packages/elasticsearch/connection/http_urllib3.py", line 256, in perform_request
    self._raise_error(response.status, raw_data)
  File "/home/anaconda3/envs/SPICE/lib/python3.9/site-packages/elasticsearch/connection/base.py", line 287, in _raise_error
    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(
elasticsearch.exceptions.RequestError: RequestError(400, 'no handler found for uri [/csqa_wikidata/entities/_search] and method [POST]', 'no handler found for uri [/csqa_wikidata/entities/_search] and method [POST]')

Is there any additional setting I missed?

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