Skip to content

A simple text generator as well as words segmentation

Notifications You must be signed in to change notification settings

IcyTempest/Text-Augmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text-Augmentation

Text generating with the ability of Word Segmentation

    filename = 'newPage'
# If dak word normally, modify segment to false
# If wants to segment word, add space to each word,
# for Intent.I, adding space for entity is optional
segment: bool = False

words1 = convert(
    intent=Intent.Person,
    segment=segment,
    words=[" Manuth ", "ម៉ាន៉ុត", " Rithiya ", "រិទ្ធិយ៉ា", " Chhunheang ", "ឈុនហ៊ាង",
           " Kimhong ", "គីមហុង", " Nary ",
           "ណារី", " Nao ", "ណោ"])

words2 = convert(
    intent=Intent.O,
    segment=segment,
    words=["មាន ដឹង សាលា មាន ", "ដឹង ថា សាលា មាន "])

words3 = convert(
    intent=Intent.Person,
    segment=segment,
    words=[' Facebook page ', "ហ្វេសបុកភេច", " social media page ", "សូសលមីឌិរភេច", " page ",
           "ភេច",
           " instagram page ", "អុីនស្តាក្រាម ភេច", " Twitter ", "ថ្វីតធឺរ", " TikTok ",
           "តិកតុក"])

words4 = convert(
    intent=Intent.O,
    segment=segment,
    words=["អត់?", "ទេ?"])

sentences(filename, word1=words1, word2=words2, word3=words3, word4=words4, segment=segment)

img_2.png

To enable Word Segment:

  • simply add True to the variable Segment
  • add space to every word, Entity is optional:
    segment: bool = True

Result: img.png

About

A simple text generator as well as words segmentation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages