泰语文本生成器库

ttg的Python项目详细描述


泰语文本生成器

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

泰语文本生成器

安装

pip install ttg

如果要使用thai2fit,可以安装:

^{pr2}$

示例

fromthaitextgeneratorimport*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=("คน","ดี"))# Thai2Fitfromthaitextgenerator.thai2fitimportgen_sentencegen_sentence()

文件

N-克

import

fromthaitextgeneratorimport*

统一语法

我们支持语料库

  • TNC:泰国国家语料库(默认)
  • 泰语教科书语料库
  • 奥斯卡:开放超大型爬行年鉴语料库
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)

双目图

我们支持语料库

  • TNC:泰国国家语料库(默认)
Bigram(name="tnc")Bigram().gen_sentence(N:int=4,prob:float=0.001,start_seq:str=None,output_str:bool=True,duplicate:bool=False)

钨极氩弧焊

我们支持语料库

  • TNC:泰国国家语料库(默认)
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

# Thai2Fitfromthaitextgenerator.thai2fitimportgen_sentenceen_sentence(N:int=4,prob:float=0.001,start_seq:str=None,output_str:bool=True)

许可证

   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.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在windows上向doclet添加多个sourcepath?   java谷歌地图应用程序   java为以下场景创建正则表达式   Java文件通道异常   Java集合如何将文件对象列表转换为路径对象列表?   多线程生产者/消费者模型使用Java(同步),但始终运行同一线程   java如何为存储在ArrayList中的特定属性设置值?   java一次不能加载多个osm文件   使用java 8将map<String,map<Long,customeObject>>转换为list<customeObject>   java JDK包含哪些脚本语言解释器?   java为什么eclipse在这里生成语法错误?   多线程Javasocket异常:socket已关闭且值为空   java我想在Android活动中创建一个带有图像的可滚动文本列表。我应该用什么?   java实现编译时警告   java根据安卓 SQLite数据库中前一行的相同值递增特定值   java移动迭代器语句使代码可编译   java JVM终身/旧代已达到限制&服务器挂起   为什么我们不能在映射上使用迭代器(Java)?   xml如何映射JAXB中已有的JavaBean