Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1040580
Generated from 0e4a71a5607b0d0e1a69c094161ed968ce7dbc25 (#2503)
AutorestCI May 2, 2018
4a99451
Generated from a630b12320f25ed377697f8eb1c036b8e5965948 (#2994)
AutorestCI Jul 26, 2018
415c3db
Merge branch 'master' into restapi_auto_cognitiveservices/data-plane/…
lmazuel Nov 9, 2018
080e616
Packaging update of azure-cognitiveservices-language-textanalytics
azuresdkci Nov 9, 2018
deda25f
Update sdk_packaging.toml
lmazuel Nov 9, 2018
62c0121
Packaging update of azure-cognitiveservices-language-textanalytics
azuresdkci Nov 9, 2018
a166ff5
Update version.py
lmazuel Nov 9, 2018
f67cb32
ChangeLog
lmazuel Nov 9, 2018
04a0563
Remove deprecated file
lmazuel Nov 9, 2018
876dabd
changed reference from deprecated TextAnalyticsAPI to TextAnalyticsCl…
iscai-msft Nov 19, 2018
f48ef0c
edited text analytics teset to pass travis (#3827)
iscai-msft Nov 19, 2018
a7c83e9
Generated from 0c66ba7bcfca68e6e6cbc98f38f1ab5b9c7e0ed6 (#3852)
AutorestCI Nov 21, 2018
8579bb1
Merge branch 'master' into restapi_auto_cognitiveservices/data-plane/…
lmazuel Jan 8, 2019
5eb879c
[AutoPR cognitiveservices/data-plane/TextAnalytics] Users/laramume/ad…
AutorestCI Feb 22, 2019
826bc9d
Merge branch 'master' into restapi_auto_cognitiveservices/data-plane/…
iscai-msft Mar 12, 2019
f80e07c
Packaging update of azure-cognitiveservices-language-textanalytics
azuresdkci Mar 12, 2019
fa9bd02
updated versioning and change log
iscai-msft Mar 12, 2019
eb7a8a0
Merge branch 'restapi_auto_cognitiveservices/data-plane/TextAnalytics…
iscai-msft Mar 12, 2019
3141371
re-recorded tests
iscai-msft Mar 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions azure-cognitiveservices-language-textanalytics/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,43 @@
Release History
===============

0.2.0 (2019-03-12)
++++++++++++++++++

**Features**

- Client class can be used as a context manager to keep the underlying HTTP session open for performance
- New method "entities"
- Model KeyPhraseBatchResultItem has a new parameter statistics
- Model KeyPhraseBatchResult has a new parameter statistics
- Model LanguageBatchResult has a new parameter statistics
- Model LanguageBatchResultItem has a new parameter statistics
- Model SentimentBatchResult has a new parameter statistics

**Breaking changes**

- TextAnalyticsAPI main client has been renamed TextAnalyticsClient
- TextAnalyticsClient parameter is no longer a region but a complete endpoint

**General Breaking changes**

This version uses a next-generation code generator that *might* introduce breaking changes.

- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments.
To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments.
- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered.
While this is not a breaking change, the distinctions are important, and are documented here:
https://docs.python.org/3/library/enum.html#others
At a glance:

- "is" should not be used at all.
- "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered.

**Bugfixes**

- Compatibility of the sdist with wheel 0.31.0


0.1.0 (2018-01-12)
++++++++++++++++++

Expand Down
1 change: 1 addition & 0 deletions azure-cognitiveservices-language-textanalytics/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
recursive-include tests *.py *.yaml
include *.rst
include azure/__init__.py
include azure/cognitiveservices/__init__.py
Expand Down
19 changes: 0 additions & 19 deletions azure-cognitiveservices-language-textanalytics/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,6 @@ This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.
For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


Compatibility
=============

**IMPORTANT**: If you have an earlier version of the azure package
(version < 1.0), you should uninstall it before installing this package.

You can check the version using pip:

.. code:: shell

pip freeze

If you see azure==0.11.0 (or any version below 1.0), uninstall it first:

.. code:: shell

pip uninstall azure


Usage
=====

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
# regenerated.
# --------------------------------------------------------------------------

from .text_analytics_api import TextAnalyticsAPI
from .text_analytics_client import TextAnalyticsClient
from .version import VERSION

__all__ = ['TextAnalyticsAPI']
__all__ = ['TextAnalyticsClient']

__version__ = VERSION

Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,68 @@
# regenerated.
# --------------------------------------------------------------------------

from .multi_language_input import MultiLanguageInput
from .multi_language_batch_input import MultiLanguageBatchInput
from .key_phrase_batch_result_item import KeyPhraseBatchResultItem
from .error_record import ErrorRecord
from .key_phrase_batch_result import KeyPhraseBatchResult
from .internal_error import InternalError
from .error_response import ErrorResponse, ErrorResponseException
from .input import Input
from .batch_input import BatchInput
from .detected_language import DetectedLanguage
from .language_batch_result_item import LanguageBatchResultItem
from .language_batch_result import LanguageBatchResult
from .sentiment_batch_result_item import SentimentBatchResultItem
from .sentiment_batch_result import SentimentBatchResult
from .text_analytics_api_enums import (
AzureRegions,
)
try:
from .multi_language_input_py3 import MultiLanguageInput
from .multi_language_batch_input_py3 import MultiLanguageBatchInput
from .match_record_py3 import MatchRecord
from .entity_record_py3 import EntityRecord
from .document_statistics_py3 import DocumentStatistics
from .entities_batch_result_item_py3 import EntitiesBatchResultItem
from .error_record_py3 import ErrorRecord
from .request_statistics_py3 import RequestStatistics
from .entities_batch_result_py3 import EntitiesBatchResult
from .internal_error_py3 import InternalError
from .error_response_py3 import ErrorResponse, ErrorResponseException
from .key_phrase_batch_result_item_py3 import KeyPhraseBatchResultItem
from .key_phrase_batch_result_py3 import KeyPhraseBatchResult
from .language_input_py3 import LanguageInput
from .language_batch_input_py3 import LanguageBatchInput
from .detected_language_py3 import DetectedLanguage
from .language_batch_result_item_py3 import LanguageBatchResultItem
from .language_batch_result_py3 import LanguageBatchResult
from .sentiment_batch_result_item_py3 import SentimentBatchResultItem
from .sentiment_batch_result_py3 import SentimentBatchResult
except (SyntaxError, ImportError):
from .multi_language_input import MultiLanguageInput
from .multi_language_batch_input import MultiLanguageBatchInput
from .match_record import MatchRecord
from .entity_record import EntityRecord
from .document_statistics import DocumentStatistics
from .entities_batch_result_item import EntitiesBatchResultItem
from .error_record import ErrorRecord
from .request_statistics import RequestStatistics
from .entities_batch_result import EntitiesBatchResult
from .internal_error import InternalError
from .error_response import ErrorResponse, ErrorResponseException
from .key_phrase_batch_result_item import KeyPhraseBatchResultItem
from .key_phrase_batch_result import KeyPhraseBatchResult
from .language_input import LanguageInput
from .language_batch_input import LanguageBatchInput
from .detected_language import DetectedLanguage
from .language_batch_result_item import LanguageBatchResultItem
from .language_batch_result import LanguageBatchResult
from .sentiment_batch_result_item import SentimentBatchResultItem
from .sentiment_batch_result import SentimentBatchResult

__all__ = [
'MultiLanguageInput',
'MultiLanguageBatchInput',
'KeyPhraseBatchResultItem',
'MatchRecord',
'EntityRecord',
'DocumentStatistics',
'EntitiesBatchResultItem',
'ErrorRecord',
'KeyPhraseBatchResult',
'RequestStatistics',
'EntitiesBatchResult',
'InternalError',
'ErrorResponse', 'ErrorResponseException',
'Input',
'BatchInput',
'KeyPhraseBatchResultItem',
'KeyPhraseBatchResult',
'LanguageInput',
'LanguageBatchInput',
'DetectedLanguage',
'LanguageBatchResultItem',
'LanguageBatchResult',
'SentimentBatchResultItem',
'SentimentBatchResult',
'AzureRegions',
]
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class DetectedLanguage(Model):
'score': {'key': 'score', 'type': 'float'},
}

def __init__(self, name=None, iso6391_name=None, score=None):
super(DetectedLanguage, self).__init__()
self.name = name
self.iso6391_name = iso6391_name
self.score = score
def __init__(self, **kwargs):
super(DetectedLanguage, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.iso6391_name = kwargs.get('iso6391_name', None)
self.score = kwargs.get('score', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class DetectedLanguage(Model):
"""DetectedLanguage.

:param name: Long name of a detected language (e.g. English, French).
:type name: str
:param iso6391_name: A two letter representation of the detected language
according to the ISO 639-1 standard (e.g. en, fr).
:type iso6391_name: str
:param score: A confidence score between 0 and 1. Scores close to 1
indicate 100% certainty that the identified language is true.
:type score: float
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'iso6391_name': {'key': 'iso6391Name', 'type': 'str'},
'score': {'key': 'score', 'type': 'float'},
}

def __init__(self, *, name: str=None, iso6391_name: str=None, score: float=None, **kwargs) -> None:
super(DetectedLanguage, self).__init__(**kwargs)
self.name = name
self.iso6391_name = iso6391_name
self.score = score
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class DocumentStatistics(Model):
"""DocumentStatistics.

:param characters_count: Number of text elements recognized in the
document.
:type characters_count: int
:param transactions_count: Number of transactions for the document.
:type transactions_count: int
"""

_attribute_map = {
'characters_count': {'key': 'charactersCount', 'type': 'int'},
'transactions_count': {'key': 'transactionsCount', 'type': 'int'},
}

def __init__(self, **kwargs):
super(DocumentStatistics, self).__init__(**kwargs)
self.characters_count = kwargs.get('characters_count', None)
self.transactions_count = kwargs.get('transactions_count', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class DocumentStatistics(Model):
"""DocumentStatistics.

:param characters_count: Number of text elements recognized in the
document.
:type characters_count: int
:param transactions_count: Number of transactions for the document.
:type transactions_count: int
"""

_attribute_map = {
'characters_count': {'key': 'charactersCount', 'type': 'int'},
'transactions_count': {'key': 'transactionsCount', 'type': 'int'},
}

def __init__(self, *, characters_count: int=None, transactions_count: int=None, **kwargs) -> None:
super(DocumentStatistics, self).__init__(**kwargs)
self.characters_count = characters_count
self.transactions_count = transactions_count
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class EntitiesBatchResult(Model):
"""EntitiesBatchResult.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar documents: Response by document
:vartype documents:
list[~azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResultItem]
:ivar errors: Errors and Warnings by document
:vartype errors:
list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord]
:ivar statistics: (Optional) if showStats=true was specified in the
request this field will contain information about the request payload.
:vartype statistics:
~azure.cognitiveservices.language.textanalytics.models.RequestStatistics
"""

_validation = {
'documents': {'readonly': True},
'errors': {'readonly': True},
'statistics': {'readonly': True},
}

_attribute_map = {
'documents': {'key': 'documents', 'type': '[EntitiesBatchResultItem]'},
'errors': {'key': 'errors', 'type': '[ErrorRecord]'},
'statistics': {'key': 'statistics', 'type': 'RequestStatistics'},
}

def __init__(self, **kwargs):
super(EntitiesBatchResult, self).__init__(**kwargs)
self.documents = None
self.errors = None
self.statistics = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class EntitiesBatchResultItem(Model):
"""EntitiesBatchResultItem.

Variables are only populated by the server, and will be ignored when
sending a request.

:param id: Unique, non-empty document identifier.
:type id: str
:ivar entities: Recognized entities in the document.
:vartype entities:
list[~azure.cognitiveservices.language.textanalytics.models.EntityRecord]
:param statistics: (Optional) if showStats=true was specified in the
request this field will contain information about the document payload.
:type statistics:
~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics
"""

_validation = {
'entities': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'entities': {'key': 'entities', 'type': '[EntityRecord]'},
'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'},
}

def __init__(self, **kwargs):
super(EntitiesBatchResultItem, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.entities = None
self.statistics = kwargs.get('statistics', None)
Loading