fds.sdk.NaturalLanguageProcessing 0.23.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fds.sdk.NaturalLanguageProcessing-0.23.6/LICENSE +202 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/PKG-INFO +349 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/README.md +334 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/__init__.py +0 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/__init__.py +28 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/api/__init__.py +3 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/api/ai_text_summarization_api.py +1001 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/api/ai_themes_api.py +804 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/api/named_entity_recognition_api.py +290 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/api/question__answer_api.py +857 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/api_client.py +939 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/apis/__init__.py +20 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/configuration.py +496 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/exceptions.py +160 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/__init__.py +5 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/error.py +262 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/error_source.py +268 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/http_error.py +288 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/http_error_root.py +268 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/ner_entity.py +314 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/ner_entity_list.py +262 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/ner_input_data_schema.py +270 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/ner_input_schema.py +262 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/ner_organization.py +264 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/ner_response_schema.py +272 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/qn_a_answer.py +268 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/qn_a_answer_parameters.py +284 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/qn_a_answer_parameters_root.py +272 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/qn_a_answer_root.py +272 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/summarization_http_error.py +260 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/summarization_request.py +262 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/summarization_result.py +260 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/summarization_result_id.py +256 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/task.py +283 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/task_root.py +272 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/theme_sentiment.py +283 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/theme_sentiments_root.py +272 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/themes_parameters.py +272 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/themes_parameters_root.py +272 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/validation_error.py +266 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/validation_error_detail.py +262 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model/validation_error_detail_location.py +256 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/model_utils.py +2062 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/models/__init__.py +38 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/NaturalLanguageProcessing/rest.py +347 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds/sdk/__init__.py +0 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds.sdk.NaturalLanguageProcessing.egg-info/PKG-INFO +349 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds.sdk.NaturalLanguageProcessing.egg-info/SOURCES.txt +52 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds.sdk.NaturalLanguageProcessing.egg-info/dependency_links.txt +1 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds.sdk.NaturalLanguageProcessing.egg-info/requires.txt +3 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/fds.sdk.NaturalLanguageProcessing.egg-info/top_level.txt +1 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/setup.cfg +7 -0
- fds.sdk.NaturalLanguageProcessing-0.23.6/setup.py +47 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2019 FactSet Research Systems Inc
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: fds.sdk.NaturalLanguageProcessing
|
|
3
|
+
Version: 0.23.6
|
|
4
|
+
Summary: Natural Language Processing client library for Python
|
|
5
|
+
Home-page: https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1
|
|
6
|
+
Author: FactSet Research Systems
|
|
7
|
+
License: Apache License, Version 2.0
|
|
8
|
+
Keywords: FactSet,API,SDK
|
|
9
|
+
Platform: UNKNOWN
|
|
10
|
+
Requires-Python: >=3.7
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
|
|
14
|
+
[](https://www.factset.com)
|
|
15
|
+
|
|
16
|
+
# Natural Language Processing client library for Python
|
|
17
|
+
|
|
18
|
+
[]()
|
|
19
|
+
[](https://pypi.org/project/fds.sdk.NaturalLanguageProcessing/)
|
|
20
|
+
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
21
|
+
|
|
22
|
+
APIs that leverage Natural Language Processing to help extract meaningful data from unstructured text
|
|
23
|
+
|
|
24
|
+
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
25
|
+
|
|
26
|
+
- API version: 1.3.0
|
|
27
|
+
- SDK version: 0.23.6
|
|
28
|
+
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
|
|
29
|
+
|
|
30
|
+
For more information, please visit [https://developer.factset.com/contact](https://developer.factset.com/contact)
|
|
31
|
+
|
|
32
|
+
## Requirements
|
|
33
|
+
|
|
34
|
+
* Python >= 3.7
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
### Poetry
|
|
39
|
+
|
|
40
|
+
```shell
|
|
41
|
+
poetry add fds.sdk.utils fds.sdk.NaturalLanguageProcessing==0.23.6
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### pip
|
|
45
|
+
|
|
46
|
+
```shell
|
|
47
|
+
pip install fds.sdk.utils fds.sdk.NaturalLanguageProcessing==0.23.6
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
|
|
52
|
+
1. [Generate authentication credentials](../../../../README.md#authentication).
|
|
53
|
+
2. Setup Python environment.
|
|
54
|
+
1. Install and activate python 3.7+. If you're using [pyenv](https://github.com/pyenv/pyenv):
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
pyenv install 3.9.7
|
|
58
|
+
pyenv shell 3.9.7
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
2. (optional) [Install poetry](https://python-poetry.org/docs/#installation).
|
|
62
|
+
3. [Install dependencies](#installation).
|
|
63
|
+
4. Run the following:
|
|
64
|
+
|
|
65
|
+
> [!IMPORTANT]
|
|
66
|
+
> The parameter variables defined below are just examples and may potentially contain non valid values. Please replace them with valid values.
|
|
67
|
+
|
|
68
|
+
### Example Code
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from fds.sdk.utils.authentication import ConfidentialClient
|
|
72
|
+
|
|
73
|
+
import fds.sdk.NaturalLanguageProcessing
|
|
74
|
+
from fds.sdk.NaturalLanguageProcessing.api import ai_text_summarization_api
|
|
75
|
+
from fds.sdk.NaturalLanguageProcessing.models import *
|
|
76
|
+
from dateutil.parser import parse as dateutil_parser
|
|
77
|
+
from pprint import pprint
|
|
78
|
+
|
|
79
|
+
# See configuration.py for a list of all supported configuration parameters.
|
|
80
|
+
|
|
81
|
+
# Examples for each supported authentication method are below,
|
|
82
|
+
# choose one that satisfies your use case.
|
|
83
|
+
|
|
84
|
+
# (Preferred) OAuth 2.0: FactSetOAuth2
|
|
85
|
+
# See https://github.com/FactSet/enterprise-sdk#oauth-20
|
|
86
|
+
# for information on how to create the app-config.json file
|
|
87
|
+
#
|
|
88
|
+
# The confidential client instance should be reused in production environments.
|
|
89
|
+
# See https://github.com/FactSet/enterprise-sdk-utils-python#authentication
|
|
90
|
+
# for more information on using the ConfidentialClient class
|
|
91
|
+
configuration = fds.sdk.NaturalLanguageProcessing.Configuration(
|
|
92
|
+
fds_oauth_client=ConfidentialClient('/path/to/app-config.json')
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
# Basic authentication: FactSetApiKey
|
|
96
|
+
# See https://github.com/FactSet/enterprise-sdk#api-key
|
|
97
|
+
# for information how to create an API key
|
|
98
|
+
# configuration = fds.sdk.NaturalLanguageProcessing.Configuration(
|
|
99
|
+
# username='USERNAME-SERIAL',
|
|
100
|
+
# password='API-KEY'
|
|
101
|
+
# )
|
|
102
|
+
|
|
103
|
+
# Enter a context with an instance of the API client
|
|
104
|
+
with fds.sdk.NaturalLanguageProcessing.ApiClient(configuration) as api_client:
|
|
105
|
+
# Create an instance of the API class
|
|
106
|
+
api_instance = ai_text_summarization_api.AITextSummarizationApi(api_client)
|
|
107
|
+
summarization_request = SummarizationRequest(
|
|
108
|
+
text="Advanced Energy Transforms Indoor Farming With Intelligent New Lighting Power and Control System Friday, December 11, 2020 01:00:00 PM (GMT)Innovative technology breaks down barriers to indoor, vertical and greenhouse farming by reducing power consumption, cutting costs and increasing crop yield Advanced Energy (Nasdaq: AEIS) – a global leader in highly engineered, precision power conversion, measurement, and control solutions – today unveiled its newest lighting and power control system for indoor, vertical and greenhouse farming. This press release features multimedia. Advanced Energy's new Artesyn iTS provides the industry's first solution for switching or sharing a single power source between two different rooms. This reduces installation costs by cutting the number of iHP power supplies needed in half and it substantially reduces ongoing utility costs. (Photo: Business Wire)AE's new lighting and power system transforms the use of LED technology in horticultural lighting systems, which plays a fundamental role in cutting-edge farming practices that can address production challenges in food, pharmaceutical ingredients, plants and flowers. Utilizing AE's system, customers reduce their power conversion costs by as much as 50 percent, significantly lower installation and operating costs, and increase the quality of crop yield. "Our groundbreaking lighting, power and control system delivers significant improvements over conventional lighting solutions and opens up new opportunities for the industry," said Joe Voyles, vice president, industrial marketing, at Advanced Energy. "We are transforming our customers' operations by both reducing the amount of needed equipment and improving the efficiency of the lighting systems, thereby reducing cost and energy spend. Not only do these innovative new products increase the efficiency and quality of fruit and vegetable production, but they also open the door to establishing indoor farming facilities in harsh environments anywhere in the world." The new system consists of the patented Artesyn iTS (intelligent Transfer Switch) and iHPS configurable power supply. Alongside Artesyn's compact new 12 kW 300 VDC module, AE delivers a cost-effective platform for the most advanced indoor farming applications. The system is estimated to produce a 38 percent savings to lighting power and control installation cost, while eliminating substantial amounts of wasted energy. The new iHPS is a "short" version of AE's market-leading iHP power supply. The shorter design allows for more space within the lighting and power cabinet for other crucial components, reduces the weight and cost, and increases the life of the system. The new iTS provides the industry's first solution for switching or sharing a single power source between two different rooms. This reduces installation costs by cutting the number of iHP power supplies needed in half and it substantially reduces ongoing utility costs.",
|
|
109
|
+
) # SummarizationRequest | (optional)
|
|
110
|
+
|
|
111
|
+
try:
|
|
112
|
+
# Endpoint to generate a headline from text
|
|
113
|
+
# example passing only required values which don't have defaults set
|
|
114
|
+
# and optional values
|
|
115
|
+
api_response = api_instance.summarization_headline(summarization_request=summarization_request)
|
|
116
|
+
|
|
117
|
+
pprint(api_response)
|
|
118
|
+
except fds.sdk.NaturalLanguageProcessing.ApiException as e:
|
|
119
|
+
print("Exception when calling AITextSummarizationApi->summarization_headline: %s\n" % e)
|
|
120
|
+
|
|
121
|
+
# # Get response, http status code and response headers
|
|
122
|
+
# try:
|
|
123
|
+
# # Endpoint to generate a headline from text
|
|
124
|
+
# api_response, http_status_code, response_headers = api_instance.summarization_headline_with_http_info(summarization_request=summarization_request)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
# pprint(api_response)
|
|
128
|
+
# pprint(http_status_code)
|
|
129
|
+
# pprint(response_headers)
|
|
130
|
+
# except fds.sdk.NaturalLanguageProcessing.ApiException as e:
|
|
131
|
+
# print("Exception when calling AITextSummarizationApi->summarization_headline: %s\n" % e)
|
|
132
|
+
|
|
133
|
+
# # Get response asynchronous
|
|
134
|
+
# try:
|
|
135
|
+
# # Endpoint to generate a headline from text
|
|
136
|
+
# async_result = api_instance.summarization_headline_async(summarization_request=summarization_request)
|
|
137
|
+
# api_response = async_result.get()
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
# pprint(api_response)
|
|
141
|
+
# except fds.sdk.NaturalLanguageProcessing.ApiException as e:
|
|
142
|
+
# print("Exception when calling AITextSummarizationApi->summarization_headline: %s\n" % e)
|
|
143
|
+
|
|
144
|
+
# # Get response, http status code and response headers asynchronous
|
|
145
|
+
# try:
|
|
146
|
+
# # Endpoint to generate a headline from text
|
|
147
|
+
# async_result = api_instance.summarization_headline_with_http_info_async(summarization_request=summarization_request)
|
|
148
|
+
# api_response, http_status_code, response_headers = async_result.get()
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
# pprint(api_response)
|
|
152
|
+
# pprint(http_status_code)
|
|
153
|
+
# pprint(response_headers)
|
|
154
|
+
# except fds.sdk.NaturalLanguageProcessing.ApiException as e:
|
|
155
|
+
# print("Exception when calling AITextSummarizationApi->summarization_headline: %s\n" % e)
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Using Pandas
|
|
160
|
+
|
|
161
|
+
To convert an API response to a Pandas DataFrame, it is necessary to transform it first to a dictionary.
|
|
162
|
+
```python
|
|
163
|
+
import pandas as pd
|
|
164
|
+
|
|
165
|
+
response_dict = api_response.to_dict()['data']
|
|
166
|
+
|
|
167
|
+
simple_json_response = pd.DataFrame(response_dict)
|
|
168
|
+
nested_json_response = pd.json_normalize(response_dict)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Debugging
|
|
172
|
+
|
|
173
|
+
The SDK uses the standard library [`logging`](https://docs.python.org/3/library/logging.html#module-logging) module.
|
|
174
|
+
|
|
175
|
+
Setting `debug` to `True` on an instance of the `Configuration` class sets the log-level of related packages to `DEBUG`
|
|
176
|
+
and enables additional logging in Pythons [HTTP Client](https://docs.python.org/3/library/http.client.html).
|
|
177
|
+
|
|
178
|
+
**Note**: This prints out sensitive information (e.g. the full request and response). Use with care.
|
|
179
|
+
|
|
180
|
+
```python
|
|
181
|
+
import logging
|
|
182
|
+
import fds.sdk.NaturalLanguageProcessing
|
|
183
|
+
|
|
184
|
+
logging.basicConfig(level=logging.DEBUG)
|
|
185
|
+
|
|
186
|
+
configuration = fds.sdk.NaturalLanguageProcessing.Configuration(...)
|
|
187
|
+
configuration.debug = True
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Configure a Proxy
|
|
191
|
+
|
|
192
|
+
You can pass proxy settings to the Configuration class:
|
|
193
|
+
|
|
194
|
+
* `proxy`: The URL of the proxy to use.
|
|
195
|
+
* `proxy_headers`: a dictionary to pass additional headers to the proxy (e.g. `Proxy-Authorization`).
|
|
196
|
+
|
|
197
|
+
```python
|
|
198
|
+
import fds.sdk.NaturalLanguageProcessing
|
|
199
|
+
|
|
200
|
+
configuration = fds.sdk.NaturalLanguageProcessing.Configuration(
|
|
201
|
+
# ...
|
|
202
|
+
proxy="http://secret:password@localhost:5050",
|
|
203
|
+
proxy_headers={
|
|
204
|
+
"Custom-Proxy-Header": "Custom-Proxy-Header-Value"
|
|
205
|
+
}
|
|
206
|
+
)
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Custom SSL Certificate
|
|
210
|
+
|
|
211
|
+
TLS/SSL certificate verification can be configured with the following Configuration parameters:
|
|
212
|
+
|
|
213
|
+
* `ssl_ca_cert`: a path to the certificate to use for verification in `PEM` format.
|
|
214
|
+
* `verify_ssl`: setting this to `False` disables the verification of certificates.
|
|
215
|
+
Disabling the verification is not recommended, but it might be useful during
|
|
216
|
+
local development or testing.
|
|
217
|
+
|
|
218
|
+
```python
|
|
219
|
+
import fds.sdk.NaturalLanguageProcessing
|
|
220
|
+
|
|
221
|
+
configuration = fds.sdk.NaturalLanguageProcessing.Configuration(
|
|
222
|
+
# ...
|
|
223
|
+
ssl_ca_cert='/path/to/ca.pem'
|
|
224
|
+
)
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Request Retries
|
|
228
|
+
|
|
229
|
+
In case the request retry behaviour should be customized, it is possible to pass a `urllib3.Retry` object to the `retry` property of the Configuration.
|
|
230
|
+
|
|
231
|
+
```python
|
|
232
|
+
from urllib3 import Retry
|
|
233
|
+
import fds.sdk.NaturalLanguageProcessing
|
|
234
|
+
|
|
235
|
+
configuration = fds.sdk.NaturalLanguageProcessing.Configuration(
|
|
236
|
+
# ...
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
configuration.retries = Retry(total=3, status_forcelist=[500, 502, 503, 504])
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
## Documentation for API Endpoints
|
|
244
|
+
|
|
245
|
+
All URIs are relative to *https://api.factset.com/cognitive/nlp/v1*
|
|
246
|
+
|
|
247
|
+
Class | Method | HTTP request | Description
|
|
248
|
+
------------ | ------------- | ------------- | -------------
|
|
249
|
+
*AITextSummarizationApi* | [**summarization_headline**](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/AITextSummarizationApi.md#summarization_headline) | **POST** /summarization/headline | Endpoint to generate a headline from text
|
|
250
|
+
*AITextSummarizationApi* | [**summarization_headline_and_summary**](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/AITextSummarizationApi.md#summarization_headline_and_summary) | **POST** /summarization/headline-and-summary | Endpoint to summarize and generate a headline from text
|
|
251
|
+
*AITextSummarizationApi* | [**summarization_result**](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/AITextSummarizationApi.md#summarization_result) | **GET** /summarization/result/{resultId} | Endpoint to obtain result of a particular summarization job
|
|
252
|
+
*AITextSummarizationApi* | [**summarization_summary**](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/AITextSummarizationApi.md#summarization_summary) | **POST** /summarization/summary | Endpoint to summarize text
|
|
253
|
+
*AIThemesApi* | [**themes_extract_themes**](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/AIThemesApi.md#themes_extract_themes) | **POST** /themes | Endpoint to begin theme extraction job
|
|
254
|
+
*AIThemesApi* | [**themes_get_status**](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/AIThemesApi.md#themes_get_status) | **GET** /themes/{id}/status | Endpoint to get the completion status of a themes job
|
|
255
|
+
*AIThemesApi* | [**themes_get_themes**](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/AIThemesApi.md#themes_get_themes) | **GET** /themes/{id} | Endpoint to get a theme (and sentiments if requested) job result
|
|
256
|
+
*NamedEntityRecognitionApi* | [**ner_entities**](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/NamedEntityRecognitionApi.md#ner_entities) | **POST** /ner/entities | Endpoint to detect entities from text
|
|
257
|
+
*QuestionAnswerApi* | [**qna_get_answers**](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/QuestionAnswerApi.md#qna_get_answers) | **GET** /qna/answers/{id} | Endpoint to get the answer(s)
|
|
258
|
+
*QuestionAnswerApi* | [**qna_get_status**](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/QuestionAnswerApi.md#qna_get_status) | **GET** /qna/answers/{id}/status | Endpoint to get the completion status for a Q&A request
|
|
259
|
+
*QuestionAnswerApi* | [**qna_post_question**](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/QuestionAnswerApi.md#qna_post_question) | **POST** /qna/answers | Endpoint to submit a question for answer(s)
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
## Documentation For Models
|
|
263
|
+
|
|
264
|
+
- [Error](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/Error.md)
|
|
265
|
+
- [ErrorSource](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/ErrorSource.md)
|
|
266
|
+
- [HTTPError](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/HTTPError.md)
|
|
267
|
+
- [HTTPErrorRoot](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/HTTPErrorRoot.md)
|
|
268
|
+
- [NEREntity](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/NEREntity.md)
|
|
269
|
+
- [NEREntityList](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/NEREntityList.md)
|
|
270
|
+
- [NERInputDataSchema](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/NERInputDataSchema.md)
|
|
271
|
+
- [NERInputSchema](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/NERInputSchema.md)
|
|
272
|
+
- [NEROrganization](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/NEROrganization.md)
|
|
273
|
+
- [NERResponseSchema](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/NERResponseSchema.md)
|
|
274
|
+
- [QnAAnswer](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/QnAAnswer.md)
|
|
275
|
+
- [QnAAnswerParameters](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/QnAAnswerParameters.md)
|
|
276
|
+
- [QnAAnswerParametersRoot](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/QnAAnswerParametersRoot.md)
|
|
277
|
+
- [QnAAnswerRoot](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/QnAAnswerRoot.md)
|
|
278
|
+
- [SummarizationHTTPError](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/SummarizationHTTPError.md)
|
|
279
|
+
- [SummarizationRequest](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/SummarizationRequest.md)
|
|
280
|
+
- [SummarizationResult](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/SummarizationResult.md)
|
|
281
|
+
- [SummarizationResultID](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/SummarizationResultID.md)
|
|
282
|
+
- [Task](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/Task.md)
|
|
283
|
+
- [TaskRoot](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/TaskRoot.md)
|
|
284
|
+
- [ThemeSentiment](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/ThemeSentiment.md)
|
|
285
|
+
- [ThemeSentimentsRoot](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/ThemeSentimentsRoot.md)
|
|
286
|
+
- [ThemesParameters](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/ThemesParameters.md)
|
|
287
|
+
- [ThemesParametersRoot](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/ThemesParametersRoot.md)
|
|
288
|
+
- [ValidationError](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/ValidationError.md)
|
|
289
|
+
- [ValidationErrorDetail](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/ValidationErrorDetail.md)
|
|
290
|
+
- [ValidationErrorDetailLocation](https://github.com/FactSet/enterprise-sdk/tree/main/code/python/NaturalLanguageProcessing/v1/docs/ValidationErrorDetailLocation.md)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
## Documentation For Authorization
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
## FactSetApiKey
|
|
297
|
+
|
|
298
|
+
- **Type**: HTTP basic authentication
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
## FactSetOAuth2
|
|
302
|
+
|
|
303
|
+
- **Type**: OAuth
|
|
304
|
+
- **Flow**: application
|
|
305
|
+
- **Authorization URL**:
|
|
306
|
+
- **Scopes**: N/A
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
## Notes for Large OpenAPI documents
|
|
310
|
+
If the OpenAPI document is large, imports in fds.sdk.NaturalLanguageProcessing.apis and fds.sdk.NaturalLanguageProcessing.models may fail with a
|
|
311
|
+
RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:
|
|
312
|
+
|
|
313
|
+
Solution 1:
|
|
314
|
+
Use specific imports for apis and models like:
|
|
315
|
+
- `from fds.sdk.NaturalLanguageProcessing.api.default_api import DefaultApi`
|
|
316
|
+
- `from fds.sdk.NaturalLanguageProcessing.model.pet import Pet`
|
|
317
|
+
|
|
318
|
+
Solution 2:
|
|
319
|
+
Before importing the package, adjust the maximum recursion limit as shown below:
|
|
320
|
+
```
|
|
321
|
+
import sys
|
|
322
|
+
sys.setrecursionlimit(1500)
|
|
323
|
+
import fds.sdk.NaturalLanguageProcessing
|
|
324
|
+
from fds.sdk.NaturalLanguageProcessing.apis import *
|
|
325
|
+
from fds.sdk.NaturalLanguageProcessing.models import *
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
## Contributing
|
|
329
|
+
|
|
330
|
+
Please refer to the [contributing guide](../../../../CONTRIBUTING.md).
|
|
331
|
+
|
|
332
|
+
## Copyright
|
|
333
|
+
|
|
334
|
+
Copyright 2022 FactSet Research Systems Inc
|
|
335
|
+
|
|
336
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
337
|
+
you may not use this file except in compliance with the License.
|
|
338
|
+
You may obtain a copy of the License at
|
|
339
|
+
|
|
340
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
341
|
+
|
|
342
|
+
Unless required by applicable law or agreed to in writing, software
|
|
343
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
344
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
345
|
+
See the License for the specific language governing permissions and
|
|
346
|
+
limitations under the License.
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|