mirror of
https://github.com/wassname/IndicoIo-python.git
synced 2026-08-09 11:40:38 +08:00
Remove ner
This commit is contained in:
@@ -9,7 +9,6 @@ from indicoio.text.sentiment import political, posneg
|
||||
from indicoio.text.sentiment import posneg as sentiment
|
||||
from indicoio.text.lang import language
|
||||
from indicoio.text.classification import classification
|
||||
from indicoio.text.ner import named_entities
|
||||
from indicoio.images.fer import fer
|
||||
from indicoio.images.features import facial_features
|
||||
from indicoio.images.features import image_features
|
||||
@@ -23,4 +22,3 @@ fer = partial(fer, config.api_root)
|
||||
facial_features = partial(facial_features, config.api_root)
|
||||
image_features = partial(image_features, config.api_root)
|
||||
classification = partial(classification, config.api_root)
|
||||
named_entities = partial(named_entities, config.api_root)
|
||||
|
||||
@@ -7,7 +7,6 @@ from indicoio.text.sentiment import political, posneg
|
||||
from indicoio.text.sentiment import posneg as sentiment
|
||||
from indicoio.text.lang import language
|
||||
from indicoio.text.classification import classification
|
||||
from indicoio.text.ner import named_entities
|
||||
from indicoio.images.fer import fer
|
||||
from indicoio.images.features import facial_features
|
||||
from indicoio.images.features import image_features
|
||||
@@ -21,4 +20,3 @@ fer = partial(fer, config.local_api_root)
|
||||
facial_features = partial(facial_features, config.local_api_root)
|
||||
image_features = partial(image_features, config.local_api_root)
|
||||
classification = partial(classification, config.local_api_root)
|
||||
named_entities = partial(named_entities, config.local_api_root)
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
from indicoio.utils import api_handler
|
||||
|
||||
def named_entities(api_root, text):
|
||||
"""
|
||||
Given input text, returns a mapping from named entities to
|
||||
named entity categories.
|
||||
|
||||
Example usage:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
>>> import indicoio
|
||||
>>> import numpy as np
|
||||
>>> text = 'On Monday, president Barack Obama will be...'
|
||||
>>> indicoio.named_entities(text)
|
||||
>>> "{'Monday': 'Time', 'Barack Obama': 'Person'}"
|
||||
|
||||
:param text: The text to be analyzed.
|
||||
:type text: str or unicode
|
||||
:rtype: Dictionary of named entity, category pairs
|
||||
"""
|
||||
|
||||
return api_handler(text, api_root + "ner")
|
||||
Reference in New Issue
Block a user