Skip to content

Commit 67b2a57

Browse files
author
Chris Park
committed
Removed entities/linked
- Removed example - Removed resolve_entities parameter and check - Updated README - tests pass
1 parent 1874e6a commit 67b2a57

File tree

5 files changed

+4
-59
lines changed

5 files changed

+4
-59
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ The samples use the following procedure:
6565
`NameSimilarityParameters`; Other parameters are optional.
6666

6767
6. Invoke the `API` method for the endpoint you are calling. The methods are
68-
* `entities(linked)` where `linked` is `False` for entity extraction and `True` for entity linking.
68+
* `entities()`
6969
* `categories()`
7070
* `sentiment()`
7171
* `language()`

examples/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Each example, when run, prints its output to the console.
2424
| ------------- |------------- |
2525
| categories.py | Gets the category of a document at a URL |
2626
| entities.py | Gets the entities from a piece of text |
27-
| entities_linked.py | Gets the linked (to Wikipedia) entities from a piece of text |
2827
| info.py | Gets information about Rosette API |
2928
| language.py | Gets the language of a piece of text |
3029
| matched-name.py | Gets the similarity score of two names |

examples/entities_linked.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

rosette/api.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -777,23 +777,17 @@ def morphology(self, parameters, facet=MorphologyOutput.COMPLETE):
777777
@return: A python dictionary containing the results of morphological analysis."""
778778
return EndpointCaller(self, "morphology/" + facet).call(parameters)
779779

780-
def entities(self, parameters, resolve_entities=False):
780+
def entities(self, parameters):
781781
"""
782782
Create an L{EndpointCaller} to identify named entities found in the texts
783783
to which it is applied and call it. Linked entity information is optional, and
784784
its need must be specified at the time the operator is created.
785785
@param parameters: An object specifying the data,
786786
and possible metadata, to be processed by the entity identifier.
787787
@type parameters: L{DocumentParameters} or L{str}
788-
@param resolve_entities: Specifies whether or not linked entity information will
789-
be wanted.
790-
@type resolve_entities: Boolean
791788
@return: A python dictionary containing the results of entity extraction."""
792-
if resolve_entities:
793-
warnings.warn("entities(params,resolve_entities) is deprecated and replaced by entities(params).", DeprecationWarning)
794-
return EndpointCaller(self, "entities/linked").call(parameters)
795-
else:
796-
return EndpointCaller(self, "entities").call(parameters)
789+
790+
return EndpointCaller(self, "entities").call(parameters)
797791

798792
def categories(self, parameters):
799793
"""

tests/test_rosette_api.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -323,21 +323,6 @@ def test_the_entities_endpoint(api, json_response, doc_params):
323323
httpretty.disable()
324324
httpretty.reset()
325325

326-
# Test the entities/linked endpoint
327-
328-
329-
def test_the_entities_linked_endpoint(api, json_response, doc_params):
330-
httpretty.enable()
331-
httpretty.register_uri(httpretty.POST, "https://api.rosette.com/rest/v1/info",
332-
body=json_response, status=200, content_type="application/json")
333-
httpretty.register_uri(httpretty.POST, "https://api.rosette.com/rest/v1/entities/linked",
334-
body=json_response, status=200, content_type="application/json")
335-
336-
result = api.entities(doc_params, True)
337-
assert result["name"] == "Rosette API"
338-
httpretty.disable()
339-
httpretty.reset()
340-
341326
# Test the categories endpoint
342327

343328

0 commit comments

Comments
 (0)