Skip to content

Commit

Permalink
Add the searched_entity parameter to NER.
Browse files Browse the repository at this point in the history
  • Loading branch information
juliensalinas committed Mar 4, 2022
1 parent a4109ce commit 6ed8bf6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Call the `question()` method and pass the following:
1. Your question

```python
client.question("<Your context>", "<Your question>")
client.question("<Your question>", "<Your context>")
```

The above command returns a JSON object.
Expand Down
5 changes: 3 additions & 2 deletions nlpcloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ def __init__(self, model, token, gpu=False, lang=""):
else:
self.root_url = "{}/{}/{}".format(BASE_URL, API_VERSION, model)

def entities(self, text):
def entities(self, text, searched_entity=None):
payload = {
"text": text
"text": text,
"searched_entity": searched_entity
}

r = requests.post(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='nlpcloud',
version='1.0.22',
version='1.0.23',
description='Python client for the NLP Cloud API',
long_description="NLP Cloud serves high performance pre-trained or custom models for NER, sentiment-analysis, classification, summarization, text generation, question answering, machine translation, language detection, semantic similarity, tokenization, POS tagging, embeddings, and dependency parsing. It is ready for production, served through a REST API.\n\nThis is the Python client for the API.\n\nMore details here: https://nlpcloud.io\n\nDocumentation: https://docs.nlpcloud.io\n\nGithub: https://github.com/nlpcloud/nlpcloud-python",
packages=['nlpcloud'],
Expand Down

0 comments on commit 6ed8bf6

Please sign in to comment.