Skip to content

Commit 7296fa5

Browse files
committed
API changes
1 parent 9fbe856 commit 7296fa5

File tree

127 files changed

+3985
-142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+3985
-142
lines changed

doc/controllers/advanced-api.md

+267-7
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,36 @@ advanced_api_controller = client.advanced_api
1515
* [Get Classification](/fl-python/doc/controllers/advanced-api.md#get-classification)
1616
* [Get QA](/fl-python/doc/controllers/advanced-api.md#get-qa)
1717
* [Get NER](/fl-python/doc/controllers/advanced-api.md#get-ner)
18+
* [Get Summary](/fl-python/doc/controllers/advanced-api.md#get-summary)
19+
* [Get Translate](/fl-python/doc/controllers/advanced-api.md#get-translate)
1820

1921

2022
# Get Classification
2123

22-
# Stemmer : Defintion and it's usage
24+
# Text Classification : Defintion and it's usage
25+
26+
A text classifier identifies the categories of the text given as input. Classifying the texts is one of the powerful preprocessing technique in topic identification and sentiment classification (product reviews, movie reviews etc)and indexing the texts while building a search system.
2327

2428
# Languages covered:
2529

30+
| Languages | ISO Code |
31+
|------------|----------|
32+
| Arabic | ar |
33+
| Bulgarian | bg |
34+
| Chinese | zh |
35+
| English | en |
36+
| French | fr |
37+
| German | de |
38+
| Greek | el |
39+
| Hindi | hi |
40+
| Russian | ru |
41+
| Spanish | es |
42+
| Swahili | sw |
43+
| Thai | th |
44+
| Turkish | tr |
45+
| Urdu | ur |
46+
| Vietnamese | vi |
47+
2648
```python
2749
def get_classification(self,
2850
body)
@@ -41,24 +63,42 @@ def get_classification(self,
4163
## Example Usage
4264

4365
```python
44-
body = jsonpickle.decode('{"key1":"val1","key2":"val2"}')
66+
body = jsonpickle.decode('{"$$__case":0,"value":{"input":{"context":"context4","lang":"lang4","labels":[{"key1":"val1","key2":"val2"}]}}}')
4567

4668
result = advanced_api_controller.get_classification(body)
4769
```
4870

71+
## Example Response *(as JSON)*
72+
73+
```json
74+
{
75+
"labels": [
76+
"positive",
77+
"negative"
78+
],
79+
"scores": [
80+
0.9966060519218445,
81+
0.0033939925488084555
82+
]
83+
}
84+
```
85+
4986
## Errors
5087

5188
| HTTP Status Code | Error Description | Exception Class |
5289
| --- | --- | --- |
5390
| 400 | Error output | [`ErrorsException`](/fl-python/doc/models/errors-exception.md) |
5491
| 426 | Please use HTTPS protocol | [`ApiClassify426ErrorException`](/fl-python/doc/models/api-classify-426-error-exception.md) |
92+
| 429 | Too Many Requests | `APIException` |
5593

5694

5795
# Get QA
5896

59-
# Stemmer : Defintion and it's usage
97+
# QA : Defintion and it's usage
6098

61-
# Languages covered:
99+
A Question Answering System retrieves the answer relevant to the question given by the user. A question answering system can be used for building a text based chatbots, search engines etc. Our question answering system is mutilingual and supports 100 + languages. Please use ISO 639-2 2 digit language code to get results. For example, use 'en' for English, 'ta' for Tamil, 'hi' for Hindi, 'fr' for French etc.
100+
101+
For ISO code reference, please check the link https://www.loc.gov/standards/iso639-2/php/code_list.php
62102

63103
```python
64104
def get_qa(self,
@@ -78,7 +118,8 @@ def get_qa(self,
78118
## Example Usage
79119

80120
```python
81-
result = advanced_api_controller.get_qa()
121+
body = jsonpickle.decode('{"$$__case":0,"value":{"input":{"question":"எவை மூன்றும் எப்போதும் ஒன்றாகவே இருக்கும்?","lang":"ta","context":"உப்பு, புளி, மிளகாய் மூன்றும் எப்போதும் ஒன்றாகவே இருக்கும். ஒருநாள், “குழம்பிற்கு யார் முக்கியம்? நீயா! நானா!” என்று சண்டை போட்டன. மூன்று பேரும் தனிதனியாகச் சென்று குழம்பில் சேரலாம் என்று முடிவு செய்தன. முதல் நாள், உப்பு மட்டும் குழம்பில் சேர்ந்து கொண்டது. “ஆ! ஒரே உப்பு! வாயில் வைக்க முடியவில்லை!” என்று எல்லோரும் கத்தினார்கள்"}}}')
122+
result = advanced_api_controller.get_qa(body)
82123
```
83124

84125
## Example Response *(as JSON)*
@@ -98,14 +139,33 @@ result = advanced_api_controller.get_qa()
98139
| --- | --- | --- |
99140
| 400 | Bad Request | [`ErrorsException`](/fl-python/doc/models/errors-exception.md) |
100141
| 426 | Please use HTTPS protocol | [`M426ErrorException`](/fl-python/doc/models/m426-error-exception.md) |
142+
| 429 | Too Many Requests | `APIException` |
101143

102144

103145
# Get NER
104146

105-
# Stemmer : Defintion and it's usage
147+
# Named Entity Recognition : Defintion and it's usage
148+
149+
Named Entity Recognitiion (NER) is extracting the specific Nouns such as, Person Names, Location names, Organization Names, Currency , Dates. It is a classification task. NER can be used as a sub-task in applications such as Search Systems, Chatbots, Question Answering systems, Text Summarization etc.
106150

107151
# Languages covered:
108152

153+
| Languages | ISO Code |
154+
|--------------------|----------|
155+
| Arabic | ar |
156+
| Chinese | zh |
157+
| Dutch | nl |
158+
| English | en |
159+
| French | fr |
160+
| German | de |
161+
| Italian | it |
162+
| Latvian | lv |
163+
| Portuguese | pt |
164+
| Spanish | es |
165+
166+
For other languages we cannot guarantee results but you can try with ISO code.
167+
For ISO code reference, please check the link https://www.loc.gov/standards/iso639-2/php/code_list.php
168+
109169
```python
110170
def get_ner(self,
111171
body=None)
@@ -124,7 +184,8 @@ def get_ner(self,
124184
## Example Usage
125185

126186
```python
127-
result = advanced_api_controller.get_ner()
187+
body = jsonpickle.decode('{"$$__case":0,"value":{"input":{"text":"إسمي محمد وأسكن في برلين","lang":"ar"}}}')
188+
result = advanced_api_controller.get_ner(body)
128189
```
129190

130191
## Example Response *(as JSON)*
@@ -152,4 +213,203 @@ result = advanced_api_controller.get_ner()
152213
| --- | --- | --- |
153214
| 400 | Bad Request | [`ErrorsException`](/fl-python/doc/models/errors-exception.md) |
154215
| 426 | Please use HTTPS protocol | [`M426ErrorException`](/fl-python/doc/models/m426-error-exception.md) |
216+
| 429 | Too Many Requests | `APIException` |
217+
218+
219+
# Get Summary
220+
221+
# Summarization : Defintion and it's usage
222+
223+
Summarization generates a crisp content of the large input text which is highly coherent.
224+
225+
| Languages | ISO Code |
226+
|-------------------------|----------|
227+
| Amharic | am |
228+
| Arabic | ar |
229+
| Azerbaijani | az |
230+
| Bengali | bn |
231+
| Burmese | my |
232+
| Chinese | zh |
233+
| English | en |
234+
| French | fr |
235+
| Gaelic; Scottish Gaelic | gd |
236+
| Gujarati | gu |
237+
| Hausa | ha |
238+
| Hindi | hi |
239+
| Igbo | ig |
240+
| Indonesian | id |
241+
| Japanese | ja |
242+
| Kirghiz; Kyrgyz | ky |
243+
| Korean | ko |
244+
| Marathi | mr |
245+
| Nepali | ne |
246+
| Oromo | om |
247+
| Persian | fa |
248+
| Portuguese | pt |
249+
| Punjabi | pa |
250+
| Pushto; Pashto | ps |
251+
| Rundi | rn |
252+
| Russian | ru |
253+
| Serbian | sr |
254+
| Sinhala; Sinhalese | si |
255+
| Somali | so |
256+
| Spanish; Castilian | es |
257+
| Swahili | sw |
258+
| Tamil | ta |
259+
| Telugu | te |
260+
| Thai | th |
261+
| Tigrinya | ti |
262+
| Turkish | tr |
263+
| Ukrainian | uk |
264+
| Urdu | ur |
265+
| Uzbek | uz |
266+
| Vietnamese | vi |
267+
| Welsh | cy |
268+
| Yoruba | yo |
269+
270+
```python
271+
def get_summary(self,
272+
body=None)
273+
```
274+
275+
## Parameters
276+
277+
| Parameter | Type | Tags | Description |
278+
| --- | --- | --- | --- |
279+
| `body` | `object` | Body, Optional | Add a JSON Input as per the schema defined below |
280+
281+
## Response Type
282+
283+
[`ApiSummaryResponse`](/doc/models/api-summary-response.md)
284+
285+
## Example Usage
286+
287+
```python
288+
body = jsonpickle.decode('{"input":{"text":"Videos that say approved vaccines are dangerous and cause autism, cancer or infertility are among those that will be taken down, the company said. The policy includes the termination of accounts of anti-vaccine influencers. Tech giants have been criticised for not doing more to counter false health information on their sites. In July, US President Joe Biden said social media platforms were largely responsible for people\'s scepticism in getting vaccinated by spreading misinformation, and appealed for them to address the issue. YouTube, which is owned by Google, said 130,000 videos were removed from its platform since last year, when it implemented a ban on content spreading misinformation about Covid vaccines. In a blog post, the company said it had seen false claims about Covid jabs spill over into misinformation about vaccines in general. The new policy covers long-approved vaccines, such as those against measles or hepatitis B. We\'re expanding our medical misinformation policies on YouTube with new guidelines on currently administered vaccines that are approved and confirmed to be safe and effective by local health authorities and the WHO, the post said, referring to the World Health Organization.","lang":"en"}}')
289+
290+
result = advanced_ap_is_controller.get_summary(body)
291+
```
292+
293+
## Example Response *(as JSON)*
294+
295+
```json
296+
{
297+
"summary": "YouTube has announced a ban on videos spreading misinformation about Covid vaccines."
298+
}
299+
```
300+
301+
## Errors
302+
303+
| HTTP Status Code | Error Description | Exception Class |
304+
| --- | --- | --- |
305+
| 400 | Bad Request | [`ErrorsException`](/doc/models/errors-exception.md) |
306+
| 426 | Please use HTTPS protocol | [`M426ErrorException`](/doc/models/m426-error-exception.md) |
307+
| 429 | Too Many Requests | `APIException` |
308+
309+
310+
# Get Translate
311+
312+
# Translation : Defintion and it's usage
313+
314+
Machine Translation is translating the text automatically from one language to another langauge.
315+
316+
# Languages covered:
317+
318+
| Languages | ISO Code |
319+
|---------------------------------------|------------|
320+
| Abkhazian | ab |
321+
| Afrikaans | af |
322+
| Amharic | am |
323+
| Bashkir | ba |
324+
| Catalan; Valencian | ca |
325+
| Chechen | ce |
326+
| Corsican | co |
327+
| Chuvash | cv |
328+
| Ewe | ee |
329+
| English | en |
330+
| Basque | eu |
331+
| Fijian | fj |
332+
| French | fr |
333+
| Galician | gl |
334+
| Gujarati | gu |
335+
| Manx | gv |
336+
| Hebrew | he |
337+
| Haitian; Haitian Creole | ht |
338+
| Armenian | hy |
339+
| Indonesian | id |
340+
| Igbo | ig |
341+
| Icelandic | is |
342+
| Japanese | ja |
343+
| Kalaallisut; Greenlandic | kl |
344+
| Ganda | lg |
345+
| Lingala | ln |
346+
| Malagasy | mg |
347+
| Marshallese | mh |
348+
| Macedonian | mk |
349+
| Mongolian | mn |
350+
| Nauru | na |
351+
| Bokmål, Norwegian; Norwegian Bokmål | nb |
352+
| Chichewa; Chewa; Nyanja | ny |
353+
| Ossetian; Ossetic | os |
354+
| Pushto; Pashto | ps |
355+
| Romansh | rm |
356+
| Rundi | rn |
357+
| Sango | sg |
358+
| Samoan | sm |
359+
| Shona | sn |
360+
| Somali | so |
361+
| Albanian | sq |
362+
| Tamil | ta |
363+
| Tigrinya | ti |
364+
| Turkmen | tk |
365+
| Tonga | to |
366+
| Turkish | tr |
367+
| Tsonga | ts |
368+
| Tatar | tt |
369+
| Tahitian | ty |
370+
| Ukrainian | uk |
371+
| Vietnamese | vi |
372+
| Walloon | wa |
373+
| Xhosa | xh |
374+
| Yoruba | yo |
375+
| Zulu | zu |
376+
377+
```python
378+
def get_translate(self,
379+
body=None)
380+
```
381+
382+
## Parameters
383+
384+
| Parameter | Type | Tags | Description |
385+
| --- | --- | --- | --- |
386+
| `body` | `object` | Body, Optional | Add a JSON Input as per the schema defined below |
387+
388+
## Response Type
389+
390+
[`ApiTranslateResponse`](/doc/models/api-translate-response.md)
391+
392+
## Example Usage
393+
394+
```python
395+
body = '{"input":{"text":"அவள் வேகமாக ஓடினாள்","lang":"ta"} }'
396+
397+
result = advanced_ap_is_controller.get_translate(body)
398+
```
399+
400+
## Example Response *(as JSON)*
401+
402+
```json
403+
{
404+
"generated_text": "இன்று நல்ல நாள்."
405+
}
406+
```
407+
408+
## Errors
409+
410+
| HTTP Status Code | Error Description | Exception Class |
411+
| --- | --- | --- |
412+
| 400 | Bad Request | [`ErrorsException`](/doc/models/errors-exception.md) |
413+
| 426 | Please use HTTPS protocol | [`M426ErrorException`](/doc/models/m426-error-exception.md) |
414+
| 429 | Too Many Requests | `APIException` |
155415

0 commit comments

Comments
 (0)