Skip to main content

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

from aift.nlp.translation import th2zh
th2zh.translate('ข้อความ', return_json=True)
from aift.nlp.translation import zh2th
zh2th.translate('你的微笑真好看。', 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('สวัสดีครับ', 'file.wav')

Speech to Text

from aift.speech import stt

stt('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.1.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

aift-1.1.1-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

Details for the file aift-1.1.1.tar.gz.

File metadata

  • Download URL: aift-1.1.1.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.15

File hashes

Hashes for aift-1.1.1.tar.gz
Algorithm Hash digest
SHA256 4a6fc625ea2590c9581565230799163402502d02657dce9805cae2d52a85cf93
MD5 d8ee4ecfa515731d35f359ef2097ca4f
BLAKE2b-256 95da362ee3faa02529d3294740b98551e3360dbb31e5fe90fd0efb1b32170224

See more details on using hashes here.

File details

Details for the file aift-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: aift-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 33.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.15

File hashes

Hashes for aift-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8021469ede12409da80cc6bea9c8236f8d336bb40735f41e754edd9c200db176
MD5 14b040d3dbcd6cbcd57d285a26759314
BLAKE2b-256 875172c1b705674561feea81921bd2a9a85993d2bde444671dca47824cf34adf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page