AI for Thai Python Package
Project description
AIFT an AI for Thai Python Package.
Contributor:
Piyawat Chuangkrud
Installation
pip install aift
How To Use
from aift import setting
setting.set_api_key('YOUR_API_KEY')
Use Case
Multimodal
TextQA
from aift.multimodal import textqa
textqa.generate('ข้อความ')
AudioQA
from aift.multimodal import audioqa
audioqa.generate('audio.mp3', 'ถอดเสียงข้อความ')
VQA
from aift.multimodal import vqa
vqa.generate('image.jpg', 'บรรยายรูปนี้')
NLP
Alignment
EN Alignment
from aift.nlp.alignment import en_alignment
en_alignment.analyze("en_text", 'th_text', return_json=True)
ZH Alignment
from aift.nlp.alignment import zh_alignment
zh_alignment.analyze("zh_text", 'th_text')
Grapheme to Phoneme
G2P
from aift.nlp import g2p
g2p.analyze('ข้อความ')
longan
Sentence Token
from aift.nlp.longan import sentence_tokenizer
sentence_tokenizer.tokenize('ข้อความ')
Tagger
from aift.nlp.longan import tagger
tagger.tag('ระบุ|ข้อความ|ใน|นี้')
Token Tagger
from aift.nlp.longan import token_tagger
token_tagger.tokenize_tag('ข้อความ')
Tokenizer
from aift.nlp.longan import tokenizer
tokenizer.tokenize('ข้อความ')
Name Entity Recognition
example
from aift.nlp import ner
ner.analyze('ข้อความ')
Question Answering
example
from aift.nlp import qa
qa.analyze('ข้อความ')
Sentiment Analysis
example
from aift.nlp import sentiment
sentiment.analyze('ข้อความ') # engine = ssense, emonews, thaimoji, cyberbully
sentiment.analyze('ข้อความ', engine='emonews')
sentiment.analyze('ข้อความ', engine='thaimoji')
sentiment.analyze('ข้อความ', engine='cyberbully')
Similarity
example
from aift.nlp import similarity
similarity.similarity('ข้อความ') # engine = thaiwordsim, wordapprox
similarity.similarity('ข้อความ', engine='thaiwordsim', model='thwiki') # model = thwiki, twitter
similarity.similarity('ข้อความ', engine='wordapprox', model='food', return_json=True) # model = personname, royin, food
Soundex
example
from aift.nlp import soundex
soundex.analyze('ชื่อ') # model = personname, royin
Tag Suggestion
example
from aift.nlp import tag
tag.analyze('ข้อความ', numtag=5)
Text Cleansing
example
from aift.nlp import text_cleansing
text_cleansing.clean('ข้อความ')
Text Summarization
example
from aift.nlp import text_sum
text = """
long text
"""
text_sum.summarize(text)
Tokenizer
example
from aift.nlp import tokenizer
tokenizer.tokenize('ข้อความ')
tokenizer.tokenize('ข้อความ', return_json=True)
tokenizer.tokenize('ข้อความ', engine='trexplusplus') # engine = lexto, trexplus, trexplusplus
Translation
EN-TH
from aift.nlp.translation import en2th
en2th.translate("en_text")
TH-EN
from aift.nlp.translation import th2en
th2en.translate("ข้อความ")
ZH-TH, TH-ZH
zh_translate.translate('ข้อความ', src='th', to='zh', return_json=True)
zh_translate.translate('zh_text', src='zh', to='th', return_json=True)
IMAGE
Classification
Chest X-Ray Classification
from aift.image.classification import chest_classification
chest_classification.analyze('image.jpg', return_json=True)
Mask Detection
from aift.image.classification import maskdetection
maskdetection.analyze('image.jpg')
NSFW
from aift.image.classification import nsfw
nsfw.analyze('image.jpg')
Violence Classification
from aift.image.classification import violence_classification
violence_classification.analyze('image.jpg')
Correlator
Correlator
from aift.image.correlator import correlator
correlator.analyze('image.jpg', arr='คน', num=1)
Detection
Carlogo
from aift.image.detection import carlogo
carlogo.analyze('image.jpg', return_json=True)
Face Blur
from aift.image.detection import face_blur
face_blur.analyze('image.jpg')
Face Detection
from aift.image.detection import face_detection
face_detection.analyze('image.jpg', return_json=True)
Handwritten
from aift.image.detection import handwritten
handwritten.analyze('image.jpg')
Thai License Plate Recognition
from aift.image.detection import lpr
lpr.analyze('image.jpg', crop=0, rotate=1)
Weapon Detection
from aift.image.detection import weapon_detection
weapon_detection.analyze('image.jpg')
Dicom to Image
Dicom2image
from aift.image.dicom2image import dicom2image
dicom2image.analyze('image.dcm')
Super Resolution
Super Resolution
from aift.image import super_resolution
super_resolution.analyze('image.jpg')
Thai Food
Thai Food
from aift.image import thaifood
thaifood.analyze('image.jpg')
SPEECH
Text to Speech
from aift.speech import tts
tts.convert('สวัสดีครับ', 'file.wav')
Speech to Text
from aift.speech import stt
stt.convert('file.wav', return_json=True)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aift-1.1.0.tar.gz
(13.7 kB
view details)
Built Distribution
aift-1.1.0-py3-none-any.whl
(32.6 kB
view details)
File details
Details for the file aift-1.1.0.tar.gz
.
File metadata
- Download URL: aift-1.1.0.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98bafd36f4a8b84d53f6cc7742ef5538d3d74474bedaa0b420111486c16c5695 |
|
MD5 | 88c52c1161e15b1b08871d5630a85087 |
|
BLAKE2b-256 | de7630bd48f7938933412e191c0cfc6a9f7a236c7bfc0b0e33df0ddb2af90284 |
File details
Details for the file aift-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: aift-1.1.0-py3-none-any.whl
- Upload date:
- Size: 32.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dacc032d5fba19cc3f79782ed0320e695f7ac1e3a432ce96bcb4ec58fe66070 |
|
MD5 | 034876c16fc0ded7ea30f57672ad1c85 |
|
BLAKE2b-256 | 972d2b6519a6ce4d4be872416a6d070820fd9063401a6632c70be97c1643975a |