Skip to content
This repository was archived by the owner on Sep 15, 2022. It is now read-only.

Commit 09b1b72

Browse files
committed
[apps] Update latest app instructions
1 parent 1107338 commit 09b1b72

File tree

1 file changed

+54
-58
lines changed

1 file changed

+54
-58
lines changed

apps/README.md

Lines changed: 54 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,59 @@
1-
# Applications
1+
# AI4Bharat Transliteration Application
22

3-
Contains Applications built around the Transliteration engine. The contents of this folder (to be downloaded from [latest release](https://github.com/AI4Bharat/IndianNLP-Transliteration/releases/latest)) is sufficient for usage.
3+
## Deep Indic Xlit Engine
44

5-
1. Python Library for running transliteration from Roman to Native text
6-
2. HTTPS API exposing for interation with web applications
7-
3. NN based models and related metadata
5+
A deep transliteration engine for major languages of the Indian sub-continent.
86

9-
# Usage
7+
This package provides support for:
8+
1. Python Library for transliteration from Roman to Native text (using NN-based models)
9+
2. HTTP API exposing for interation with web applications
1010

11-
### Python Library
12-
13-
*Note: Initially set pythonpath environment variable* <br>
14-
`export PYTHONPATH=path/to/xlit_apps:$PYTHONPATH`
11+
## Languages Supported
1512

16-
**Example 1** : Using word Transliteration
13+
|ISO 639 code|Language|
14+
|---|-----------------|
15+
|bn |Bengali |
16+
|gom|Konkani Goan |
17+
|gu |Gujarati |
18+
|hi |Hindi |
19+
|kn |Kannada |
20+
|mai|Maithili |
21+
|ml |Malayalam |
22+
|mr |Marathi |
23+
|pa |Punjabi (Eastern)|
24+
|sd |Sindhi (Western) |
25+
|si |Sinhala |
26+
|ta |Tamil |
27+
|te |Telugu |
28+
|ur |Urdu |
1729

18-
Note: <br>
19-
`beam_width` increases beam search size, resulting in improved accuracy but increases time/compute. <br>
20-
`topk` returns only specified number of top results.
30+
## Usage
2131

32+
### Python Library
2233

34+
Import the transliteration engine by:
2335
```
24-
from xlit_src import XlitEngine
36+
from ai4bharat.transliteration import XlitEngine
37+
```
38+
39+
**Example 1** : Using word Transliteration
40+
41+
```py
2542

2643
e = XlitEngine("hi")
2744
out = e.translit_word("aam", topk=5, beam_width=10)
2845
print(out)
2946
# output:{'hi': ['कम्प्यूटर', 'कंप्यूटर', 'कम्पूटर', 'कम्पुटर', 'कम्प्युटर']}
3047

3148
```
32-
**Example 2** : Using Sentence Transliteration
3349

34-
Note: <br>
35-
`beam_width` increases beam search size, resulting in improved accuracy but increases time/compute. <br>
36-
Only single top most prediction is returned for sentences.
50+
Note:
51+
- `beam_width` increases beam search size, resulting in improved accuracy but increases time/compute.
52+
- `topk` returns only specified number of top results.
3753

54+
**Example 2** : Using Sentence Transliteration
3855

39-
```
40-
from xlit_src import XlitEngine
56+
```py
4157

4258
e = XlitEngine("ta")
4359
out = e.translit_sentence("vanakkam ulagam !", beam_width=10)
@@ -46,10 +62,12 @@ print(out)
4662

4763
```
4864

65+
Note:
66+
- Only single top most prediction is returned for each word in sentence.
67+
4968
**Example 3** : Using Multiple language Transliteration
5069

51-
```
52-
from xlit_src import XlitEngine
70+
```py
5371

5472
e = XlitEngine(["ta", "ml"])
5573
# leave empty or use "all" to load all available languages
@@ -68,47 +86,25 @@ out = e.translit_word("amma", lang_code = "ml", topk=5, beam_width=10)
6886
print(out)
6987
# output: ['അമ്മ', 'എമ്മ', 'അമ', 'എഎമ്മ', 'അഎമ്മ']
7088

71-
7289
```
7390

74-
### Web API
91+
### Web API Server
7592

76-
1. Make required modification in SSL paths in `api_expose.py`. By default set to local host and both http & https are enabled <br>
93+
1. Make required modification in SSL paths in `api_expose.py`. By default set to local host and both http & https are enabled.
7794

78-
2. Run the API expose code <br>
79-
`$ sudo env PATH=$PATH python3 api_expose.py` <br>
80-
Export `GOOGLE_APPLICATION_CREDENTIALS` if needed, by default functions realted to Google cloud is disabled.
95+
2. Run the API expose code:
96+
`$ sudo env PATH=$PATH python3 api_expose.py`
97+
(Export `GOOGLE_APPLICATION_CREDENTIALS` if needed, by default functions realted to Google cloud is disabled.)
8198

82-
3. In browser (or) curl, use link as https://{IP-address}:{port}/tl/{lang-id}/{word in eng script} <br>
83-
If debug mode enabled port will be 8000, else port will be 80 <br>
84-
example: <br>
85-
https://localhost:80/tl/ta/amma <br>
86-
https://localhost:80/languages <br>
99+
3. In browser (or) curl, use link as http://{IP-address}:{port}/tl/{lang-id}/{word in eng script}
100+
If debug mode enabled port will be 8000, else port will be 80.
87101

102+
Example:
103+
http://localhost:80/tl/ta/amma
104+
http://localhost:80/languages
88105

89-
### Language Codes:
90-
```
91-
* bn - Bengali
92-
* gom - Konkani Goan
93-
* gu - Gujarati
94-
* hi - Hindi
95-
* kn - Kannada
96-
* mai - Maithili
97-
* ml - Malayalam
98-
* mr - Marathi
99-
* pa - Punjabi Eastern
100-
* sd - Sindhi
101-
* si - Sinhala
102-
* ta - Tamil
103-
* te - Telugu
104-
* ur - Urdu
105-
```
106+
---
106107

107-
## Dependencies:
108-
* torch
109-
* numpy
108+
## Release Notes
110109

111-
Web api, also depends
112-
* flask
113-
* flask_cors
114-
* gevent
110+
This package contains applications built around the Transliteration engine. The contents of this package can also be downloaded from [latest GitHub release](https://github.com/AI4Bharat/IndianNLP-Transliteration/releases/latest) is sufficient for inference usage.

0 commit comments

Comments
 (0)