Skip to main content

Thai Text Generator library

Project description

TTG : Thai Text Generator

Thai Text Generator

Install

pip install ttg

if you want used thai2fit, you can install :

pip install ttg[thai2fit]

Example

from thaitextgenerator import *
a=Unigram()
print(a.gen_sentence(N=10))
b=Bigram()
print(b.gen_sentence(start_seq="คน", N=10))
c=Tigram()
c.gen_sentence(N=10, start_seq=("คน","ดี"))
# Thai2Fit
from thaitextgenerator.thai2fit import gen_sentence
gen_sentence()

Docs

N-Gram

import

from thaitextgenerator import *

Unigram

we support corpus

  • TNC : Thai National Corpus (Default)
  • TCC : Thai Textbook Corpus
  • oscar : Open Super-large Crawled ALMAnaCH coRpus
Unigram(name = "tnc or tcc or oscar")

Unigram().gen_sentence(N:int=3,prob:float=0.001, start_seq:str=None ,output_str:bool = True, duplicate:bool=False)

Bigram

we support corpus

  • TNC : Thai National Corpus (Default)
Bigram(name = "tnc")

Bigram().gen_sentence(N:int=4,prob:float=0.001, start_seq:str=None, output_str:bool = True, duplicate:bool=False)

Tigram

we support corpus

  • TNC : Thai National Corpus (Default)
Tigram(name = "tnc")

Bigram().gen_sentence(N:int=4,prob:float=0.001, start_seq:tuple=None, output_str:bool = True, duplicate:bool=False)

Thai2Fit

# Thai2Fit
from thaitextgenerator.thai2fit import gen_sentence
en_sentence(N:int=4,prob:float=0.001, start_seq:str=None, output_str:bool = True)

License

   Copyright 2020 Wannaphong Phatthiyaphaibun

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

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

ttg-0.1.dev2.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

ttg-0.1.dev2-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file ttg-0.1.dev2.tar.gz.

File metadata

  • Download URL: ttg-0.1.dev2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for ttg-0.1.dev2.tar.gz
Algorithm Hash digest
SHA256 103f86b74c8779ffb033d63eb4b7cb1aa9e4a969b55a0b2be5b65a655b4f7027
MD5 c70656271fb11bbb05b502ae1071cce6
BLAKE2b-256 6993dbbe1bd5cb9da2522e7dca650328380cb9de2898510a2fea71ad670cbd92

See more details on using hashes here.

File details

Details for the file ttg-0.1.dev2-py3-none-any.whl.

File metadata

  • Download URL: ttg-0.1.dev2-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for ttg-0.1.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 0f39ebca2c9b10d14969fcf2ed6a22e80a96e3a8766c0cd9132d4979211d90ee
MD5 6de7e0fdaeefa3fa3d9128102c7923c6
BLAKE2b-256 f4a015584e9726b4e3d7cda1877b2a3fad2d191011072f072d40267c32ac071e

See more details on using hashes here.

Supported by

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