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-0.2.1.tar.gz
(13.5 kB
view hashes)
Built Distribution
aift-0.2.1-py3-none-any.whl
(32.5 kB
view hashes)