Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

TTG : Thai Text Generator

[Open In Colab](https://colab.research.google.com/drive/1X6D8J0sWNi8UgJi7Hk5YL4FqepZ7laxS?usp=sharing]

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.

Metadata

Release files for ttg 0.1.dev3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ttg 0.1.dev3
File Size Uploaded
ttg-0.1.dev3.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ttg 0.1.dev3
File Interpreter ABI Platform
ttg-0.1.dev3-py3-none-any.whl Python 3 none any Details

Total release size: 18.1 kB

Release files / ttg-0.1.dev3.tar.gz

Download URL ttg-0.1.dev3.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8841d26874061c6bd6306e50ddd307ff3359cfbb0e98e899fb55d3b72c86ab1f
BLAKE2b-256 checksum
How to use checksums
2876c59ae9332173f60b1b21bb6c28a24b9ee40ba13e1a3b4f07d9825e6fa610
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / ttg-0.1.dev3-py3-none-any.whl

Download URL ttg-0.1.dev3-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90ecd5b3b6dd39466c8013aada5e87745608b4f3afa716243100303e04686a51
BLAKE2b-256 checksum
How to use checksums
f9c8cd9d251e45bd2da5bc4e391e314a7255b9b54e6c7d76d19ac8d060689d5b
Upload date
Uploaded using Trusted Publishing?
What is 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
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page