top of page

Data Augmentation using Text Generation

 

All codes related to this blog post are present on my GitHub repository

 


As we saw in the previous post that, we can use text generation to generate similar text to the given text. If enough text is provided to the machine with proper network architecture it can actually start generating similar text. As I have shown in my previous post that we can generate similar text to trumps speech and some lyrics too.

Data is the main requirement for machine learning to work properly. Data is a core asset more precious than oil to any organization. Don't you think the similar technique we can use in data augmentation? What if we have the small amount of data about some topic and we want to have similar more data. With advancement in deep learning and hardware resources, it has become more essential to have more and more data of certain kind.

This weekend I was working with chatbot, The primary goal was to make it capable of short conversation. I went to a couple of sites serving English subtitle file (.srt) of thousands of movies. Eventually succeeded in capturing shorter conversation from srt files which are less than 8 words. Although I was able to capture millions of such conversation still something was missing. Those conversations were not for specific purpose. Particular topics of conversation were not repeated or focused throughout the conversation. I ended up making something foolish. To such chat bot If I say “Hi,” it would never reply “hello” as naturally, it should do, it would reply something nonsense instead.To solve this problem I have to have specific data centered about one topic.

Mean while working around these things I figure out that, If I give such conversation to the model capable of text generation and ask it to generate new similar sentences, it would augment my present data-set and would suffice my purpose.

For to get proof of concept I started with something that I can judge. I went to a couple of sites serving movie reviews of thousands of titles.I started with IMDB movie reviews. I have collected all reviews from Cornell Movie Dialogs Dataset.

It's very large data-set to be processed by LSTM on my machine, so I went ahead and found out only positive ratings (>= 5) from data-set. Eventually, I restricted comment size to 120 characters to capture small yet precise comments.

Our task is to -

1) To generate more comments which are similar to the +ve comments given 2) Such positive comments should not be exactly similar to the already given data for training.


Practically it's easy to generate augmented data for images, and very difficult to generate augmented data for language, this can be one of the ways by which you may generate augmented data for text.


Results :


('EPOCH : ', 0, ' | TEXT PARTITION : ', 0) follow up with: as a good play as usual. tyler perry plays never be boring. wish he could have a new play out every history, and forlong and excellent acting. had not seen the movie on a time with the music at his best. but it has a realistic film, some. i love this movie which you pay back creating, this film will nother get familiars to watch again. excellent movie. i aw love. what a great ending, great dvd for the magices great people. feel s to walten house and clarnom monster finding the ce of home scept, of your fast bed shy econolic and morgan freeman great should, shows this - a movie i heart felt tru

('EPOCH : ', 0, ' | TEXT PARTITION : ', 1) follow up with: in life . to great people showing friend ship , and closeness in hard times to the end this is a from the best of the best film with my anniousoberantem's ineey did. ticklo collectoo, don't get the marlen, auch. tim allen is one of my favorite and in the rurmy "book.00 hemofor agespous. it was a was a little suder it is so cool,oo read and always very kind. addid to a foreet for approirise, he watch for suspense, like any artherey russip hd and doing everything needed for james bond. i rented it for oodensife and my burtara roles, and the john to the around and librilore, my sen all ra

('EPOCH : ', 0, ' | TEXT PARTITION : ', 2) follow up with: rder again from the company. fast delivery & in very good condition. great old movies and great actors. we saw this on tv anyway by a 5 star. this one made for a kunce of every comedy re&#34 to those good viewing viewers. you take a suffer to access these instead of vampire.a perfect comedies. this is top all believe movies. a tlumal and action film that is always an awesome cast and stunning and sexy presentation with its britaring mystery. just sit back in time if you're a great talent from phrha fewis is an harman change scui music for im again. good stuff factrable... i plan to watch i

('EPOCH : ', 0, ' | TEXT PARTITION : ', 3) follow up with: ontinue watching this with my children for years to come! incredible movie! no hidden political agent toice. this the protect is very awesome! the dr funny and spirit are typical that the business does stime the e sinters era wooky but as i cried. great as season time yreallg sreehenter ault able and being really very enchanted, i watch it when i want. as usual! i love seilozek. thanks. loved the characters and the story line. keeps you guessing into good chance. one of our roler gabs to in the "rindearog, popcerr especially woman. drando warmor ! about all 13 your ups in the new cast. i a

('EPOCH : ', 0, ' | TEXT PARTITION : ', 4) follow up with: if your a fan of horror movies, i would recommend both of these. funny, witty, and campy amazing set to be riveting but beautiful and usuile how time has some liresmations was closenged. looks better than the death love this show.it is a great price and evan things the lives of the fight behind the intonalughe years in! what more can i say is nice and was in totally, great verdice and daughter! this movie is absolutely lost of att. great crazy. timalle down are awesome and he enjoys every season and the just saw it so far...lady. the thanks amazon this is an excellent movie. it liked it time

('EPOCH : ', 0, ' | TEXT PARTITION : ', 5) follow up with: d it when i watched it the first time. and i had to order it to go with the collection of the others a great family mysteries and that is great for the whole family to watch, but only on tv and the character kept my interest but better than this episode. in a glorious game on star. the acting was excellent, kids and disk viduis.. the dvd is good. truly a great show coming on this you are enjoying this looking television and black backatate to got much playing in family but loved the movie thanks. we inzerever thing for this movie satisfy it you will not wait to get wetch in . i could watch th

('EPOCH : ', 0, ' | TEXT PARTITION : ', 6) follow up with: f bbc period dramas based on classic literature, than this is for you!no problems and no defects! i bit this many look at it. i like it moully read, this is a bit the show.. fun , i kind of it the christmas films. love the clansis event and great collection of production that she sat his. really enjoyed. i have not seen the third in the world. if you're going to think of this will watch this one. some james bond in love done well. was excellent and looking forward to the next season. a bit of class, with himmercers to dis1 came on season one weart bug a, and the hearts, and surdousure. i wa

('EPOCH : ', 0, ' | TEXT PARTITION : ', 7) follow up with: n, even better on blu ray who can resist this cast and the talents of henson and oz making a christmas cast to buy this is really sreat. my kids and i hop in why wasked this sense of laughter, but i liked the movie in the bought, collection. great series for years from us i love the whole series. it power did a great job with this movie enjoy! i love the stories schit is the dead to the screen. one of my kind of movies. it's available and funny and some sci-fi in the story. i am a hope these decision. this wila now starts to watch this movie! i thought it had a good episode this one is so

('EPOCH : ', 1, ' | TEXT PARTITION : ', 0) follow up with: is very much and planing to get the reaming three 5 great wms in 1 set. the great hulk hogan vs ultimate sayni or. it brings back the original westerns. i highly recommend this movie! great comedy responsific. my way tom hanks wasmusity about this to see our holiday ladies on teema to package.a must for any movie collection. kenneth was not delightful in this movie. i love movies to love. it i buy movies on in it with udrice. i bought this movie to see what i want to buy the life. it is huavess some extras, character. it is one of those movies for will share it had a storyline. the movie st

('EPOCH : ', 1, ' | TEXT PARTITION : ', 1) follow up with: . it was for a mamma mia fan. they loved it. first time seeing it and it was very fun to watch. love and own it did since i are involved the movief"lawnes. great dvd always funny and my mom & just the screpy itself makes it still love it love it. my dargar wantes this movie to live in love it time worth owning with all the willer femd i am considered better than on years..... loved the collection of old films for bhart friend and flawers trark with my childhood received a very perfect time. will share it with her in the day. it has a real moment of a place in it's time. a very good stort

('EPOCH : ', 1, ' | TEXT PARTITION : ', 2) follow up with: being in it and turned out enjoying every bit of it have only watched two episides i love whedon and cloire other than great stars! this is my husband's best family favorite. she is not only done. this is a good film, i rented this at a great price on amazon appertron for furnies! great addition to my attantiane every day this is any movie that great to have it and the collection. so my favorite not be haven't need in your adults . valuea cool buff mirrelle are a way more!!!! acting of action and great. i am always hatic in the whole way. this is a snower for inthose of disney sci-fi to comp

('EPOCH : ', 1, ' | TEXT PARTITION : ', 3) follow up with: viewer guessing. holds my attention. always cannot wait until the next episode. love jack. can't go man like come with the crewionhanse ii now working good series. the bluray color is superb. 1 were in the master since he keeps you watching if there were i viewed in the cmara. still one of my favbiris serie of all time. i thought that watching the story is excellent. great concept which family moveddenple of a great writer. good movie just innots for any age gut of detting. this is a wholesome movie. it really kind of day out. miss this bud most provided. buts i really liked the show when

('EPOCH : ', 1, ' | TEXT PARTITION : ', 4) follow up with: es at a faster rate. waiting for the next one. ok this movie was totally worth the money. i love dake it very much. it is a true to watch!depp makes they do it again. saw this for years on tv get this movie. it is barking movies and these very very glorual american series definitely enjoys the movie. great show. jrs awesome quality for the next sitcom that i can foun great cheaping a fun. en my only 1 season perfect as well, i would recommend this to anyone who has this on dvd now. every one needs old staging to the love this series. it is a very dark movie. sooe for the series. loving m

('EPOCH : ', 1, ' | TEXT PARTITION : ', 5) follow up with: rest is finally one dvd. dickens' stories in film will entertain almost anone who loves a good story. where we way love and tenget so many of 2 mencisich i enjoyed this again - breakis captivating and well protuce. cate blark parts is awesome. kid shows this is a great writer. i love new..you have a good movie for me, i love it just keeps you coming. lots of really good guy, it does it back in time and accent and the decainist. we love seline and rebots so much on after. steve carell is a awesome camoow and just love it. worth looking for more of perey else down. deren just a very young man.

('EPOCH : ', 1, ' | TEXT PARTITION : ', 6) follow up with: vie and am excited to finally watch it very soon great film.very entertaining.a goo tribute to the end very much better. base of dogar kindoo kristen. just laughed it with me to bought one for the burboring hollywood replacing collections. they is one special most south movie & a great quality. this show was fantastic. the actors play the script. would intertain before each in the show. buy this a fever and so much better and i would buy it now keven jaainar turner out so far yout may enjoy this movie. can't cartor sabso and bullock you will want this one inspector lewis for... love the new s

('EPOCH : ', 1, ' | TEXT PARTITION : ', 7) follow up with: bought it. sure to be a tear jerker. i remember this show and its still funny. blu and mac are so crazy for your even from forever and eonery! great movie, by both monny wyft were as always. it was both well written as well, and as used together. i'm happy to get this very much of shadow nerga can't go borine and and it was for the dialogue. ( class, stars his pointed acting.nodga7aster. it makes it available. beautiful collelt, the music is outstanding. i can't wait to watch this one and the first one. if you are a fan of the 3d collection of movies you'll have to hope they come before

('EPOCH : ', 2, ' | TEXT PARTITION : ', 0) follow up with: o add this to my dvd collection for sure liked the fast pace and acting was superb. i think the british happy in a tv movie and theres entirely in the movie i have movie trye back to events, i am very ond right nothing to do in my parts from the right before message i never thought it was. i had seen this movie on vhs and now in call young my kidd gives a quick to me in our homicult fan. over and over and over and over again.loved this movie. a great movie from the first..this movie is awesome! crazy movie, best bit stories for the old time humor the holidays were great ! funny does this story

('EPOCH : ', 2, ' | TEXT PARTITION : ', 1) follow up with: 's mordant wit and slightly confused naivte always made me laugh. love this show it is one of my favorite never started and i found i have it on ama5 and never a presion. also, the dead was, being on right up some possible. i believe this movie is a rucging story with great factor who performed he was different afdlin. it is so funny and people have for real disnatolar for sure worth a minute. check it out, reback at all ...... a delightful comedy and comedy, story at his best but it could act. fasulty, comediank not, this one, your boftley and his fraghsta, it. kids usuray. a example of sub

('EPOCH : ', 2, ' | TEXT PARTITION : ', 2) follow up with: torchwood series. jack is back and his crew is unstopable. love it!!! the cast is so wonderful. i have watched this movie many times. i oh people think he is in this movie! broden mofrell is funny and cary grant woek into movie i have been able to stop again with parents the crew and all and keeps you interested. a good addition, and the girls alen sound evilging days to deat , with the lines to the wonderful review. you can't say enough bankle regular break i was delighted to see this movie she watches whenever i want to make me want to warch that mage is yet on bd vertion. each adventur

('EPOCH : ', 2, ' | TEXT PARTITION : ', 3) follow up with: vd loved this based on true events movie, had to have it since i worked in point pleasant and was family go renere:) a nice real series for les rided in prosell for me, not what i had on with wt fnew on your light as they would love. haven't watched this movie it was a movie that has created ge9agicters as the characters, love "long fu like this in - dr!! warter. dvd was great and knowing how bit based on perfect. and i definitely love it on watch. will too. this show likes this movie. it is a hard atotiar sement realising performance! this was a feel-good movie! love watching this hd mov

('EPOCH : ', 2, ' | TEXT PARTITION : ', 4) follow up with: a man of grace, talent and intelligence. very good and good 3 hour lenght in viewing too.if you are to joty this is the change from mele's dvd , not right in a british film. it's a lot of fun to watch. great cast and fast paced movie to watch now and am thrilles and its history that leaves in this s science thent with everyone of all times! i really enjoyed watching this show when she was something very rause by a religior!!! look forward to watching them all 5 stars, another great series. i will be the sety or priceup hba. i suggest to other times thanks for seeing this product saw this

('EPOCH : ', 2, ' | TEXT PARTITION : ', 5) follow up with: eral is a great, quirky horror with a fair amount of humor too. and the werewolf scene, awesome! we have lost fast tv series but this movie we enjoyed. nice to the time to see it in the early 2man in a colin write. glad to have it! if you love dragon and castle this is a must buy in dvd. love each other with other viewing message dul in today's white. love it! i like (look for that review maif this is the funniest movie she loves i nightbas back year. happy singing up with awhile. i really liked the plot line, she is a great good gays sawaining acdon needed and the tne story of the woman v

('EPOCH : ', 2, ' | TEXT PARTITION : ', 6) follow up with: ghed. i like to rock the party. i can honestly say it was in the top 3....best shows of this year. i can't wait for the follow, word. like this movie of course. i have must the holming hollight collection of movies. she even loves it bad ass as i away two of the books and i really enjoyed josh whifs,have purchased sponge in anacheror crykel and his at program into dasime bear, so it's can get good aftersturning this would be a trount too and it was entertaining. really like the first, enjoy the scary movies with my friend. chance, this movie was pretty spongeabally historical. great ended

('EPOCH : ', 2, ' | TEXT PARTITION : ', 7) follow up with: a gift. my friend said the movie was good, and suggests it viewing. thanks so very much. huge jults of a jagoi mind movie superhearche iron 's 1 for an intense prequel. what can you say what happen to these! this was true to not terrific i enjoyed this movie and now i love it if you like this wiam you see. it was worth it now. thank you a must" western by kept new action. a great follow up for first movie! will keep everyone saig he provides a nonent kind of 'sogince when a minions follow possible i loved these movies and it plus, also our parts monstice in every collection ,sorry exce

('EPOCH : ', 3, ' | TEXT PARTITION : ', 0) follow up with: ound then the dvd and better this is a very good movie tps the best another fantastic dip into the twilight fans this is a classic true story, the plot sides to sex life make your teen i liked it! great classic surprises!!!! love this movie..i think the well enough. all the made is great! oy brilliant. my husband and i had fot give it one this version really reminding this movie longer will watch it again and again. i lived when the lets you buy it. this is a very good movie... tell my if you like classic movies this is a great movie mories could get a lot xuman. the way to disappoint a: a w

('EPOCH : ', 3, ' | TEXT PARTITION : ', 1) follow up with: you loved the older montalbano, you will like the young one as well. the series is just as well done. this was owned the best hitnic wereson civil war. there ended their refines.with this movie was clear and cheesy and sali an.i thought it was a classic. this movie is a classic and i had to have it for my mom. so much strote. just absolutely perfect wholesome, not a about life that great nomentation homethe is the tape for insiveted of the saga. this was on one of movies better than i had traditional and wwe can watch to this one on oy own on my day lacuna. returned this movie because it i

('EPOCH : ', 3, ' | TEXT PARTITION : ', 2) follow up with: is a good mystery series with interesting characters and plots. i will be moving on to season 4 so they loved it. i bought this for my dad loves the 60s bit keaton, he orce is a great actor. this movie was a must. great evening name. i can watch this over and over, and you have to go on in any opercy. as reack with much for wonderful, and aaren's the past song not relaxing in the early fakidy. i tholough a great story line. med my young bat in wother stories in the lata movephowrest him this plays finaler. must see. it makes a continuation of suggestion from person who love it much great

('EPOCH : ', 3, ' | TEXT PARTITION : ', 3) follow up with: it. thanks & have a good day! my son has autism and he is very picky about his movies, this movie keeps inited to be more than a very datua ranser. i love it not all the way vds and star trek. it's funny fun and dr. peterther character and movies, rat4 this is a great movie transforder dark shape i wish there were more movies about carner that home. if he allen. i love this movie, really funny and it is a good movie! great game. roving kiscy and the series ended inte both movies. i love this movi so i ond it it. great acting, the extras, this movie has a brilliant story. it is delightful! enj

('EPOCH : ', 3, ' | TEXT PARTITION : ', 4) follow up with: estored these movies. i cannot say much different as i have said in other reviews. all i can say is over again, so my husband and i are all his mysteries. still one of my favorite cartoons. this dvd was very good to watch. can't bull haspee blekey and scene whe ever went more to enter them. fun box set and believable and i love to watch! it never gets old. disc stands as hollywood.h this movie makes it the best. full not sargrean you lady classic.!! the series is classic, educational and tough working to , and good stories and a lets just buy these. dogging so cancelled and who might sta

('EPOCH : ', 3, ' | TEXT PARTITION : ', 5) follow up with: all that matters. love lost. one of the best shows ever. it just pulls you in and makes you want to figure out indective! i recommend it. it took the nending of gebowirs, its one of my favorite no films on omevery abon. we have a life. well would highly recommend. this is the best show ever. the movie i sounded great receiving it as much as a great for a holiday carn king out. i hope that i have four of its list. a lot of excellent restory film at the story. good, entertaining work with strange family, and in the group tough history. great action and since i found this one as soon as it was

('EPOCH : ', 3, ' | TEXT PARTITION : ', 6) follow up with: complete high definition! so glad i finally got this movie on dvd. excellent quality. if you're a fan of the tatto and you think that this is one from season 3 . he keeps kids tuffamer and you recommend it to all. our thorrugh love penglins or story. i love the 1jthese series. didn't till but it was going to be entertaining and long and a feel good movie. pall, a long ble stretching came on the three favorite movies. would recommend to all ages. cllasing at to the plot. soldially seginion to the fixmen' around a world. so totally adult momb this has drama nicely and watching all the types of

('EPOCH : ', 3, ' | TEXT PARTITION : ', 7) follow up with: e in my top 5 anime shows! if you are a 90's kid you must add this to you dvd collection! a must have for scenes that all of us watch it 100 times all again. untimely love space baker! really sweet recording. comic bad guy is superb! it was so girl is so short and costumes and a little down and touches with me and creed which family enjoyed the entire family....thanks so much! good movie. better then season ! this is a excellent movie with a perfect appealative production and durbeds all in a companion to the season a great movie minion series related me every time wonderful upgrade to terri

('EPOCH : ', 4, ' | TEXT PARTITION : ', 0) follow up with: lma". these are definitely must see movies that i think you'll enjoy like me. the main characters are so many your fathmas when this are a fantastic. i love the action. a must see for krosc. who doesn't love this ehilt shaw's dog and a an story, and one of my favorite films!!theres a deal. comic book are good and funny to watch for. so warm harry does. this is a great adaptation of the early pants. makes it old type of movie of my its wanting these to don't watch this from its great countergh haon> this is a classic and i liked the material. it is so much better than a groups like the ol

('EPOCH : ', 4, ' | TEXT PARTITION : ', 1) follow up with: ly be played numerous times. this is another great viewing movie with simon baker, good writing and very good dears. i cannot go wrong with this.... well wrap but or care of these editions. this do wishers that have shaped it collection. what easies fun gramm, hy gridfanny has its drama of paris fant star trek... a good baseball romance..it confused. a wonderful comedy story and well done throughout. can't go wrong. my husband loves this movie. it impacted pritics i saw this for the first tem to go many times,! he was very interested in four to the millson in bbc huge just love this comedy so

('EPOCH : ', 4, ' | TEXT PARTITION : ', 2) follow up with: ious disaster movie this one was great. it showed the human spirit is willing to try and over come on that don't cocliate in a free. couldn't stop laughing. what a great film. i was very happy to make this and enjoy it when i saw the price of this set very much we have - one of the greacest movies because it kept my your seat from watching this highly recommended. i loved the stere, wholit! nice hope to purchase norm! watch their other cinemas diad of two. a criss. it's a great story. this is a hoer every impy dark shadow set of ration on the actor. it's such a fun movie. it terrifies g

('EPOCH : ', 4, ' | TEXT PARTITION : ', 3) follow up with: very well done! i think eeveryone will enjoy it. very well done movie. very intelligent thoughtful moves that over watching, 7 true stories is melissa fiction. love this movie buncheive i love this series. no one loving because beads and series there. ......very worth it, its great show it's a must watch for sure cowrall fun. love this movie!the shows were without the way songs and real. animation, heartall ps other instelles. just worth some seonerr cast at it's perfectly what can i say. i were patrecting by barney! it's a fun knowing too surprise... it's came on other series on blueara. ju

('EPOCH : ', 4, ' | TEXT PARTITION : ', 4) follow up with: ime. each episode left you satisfied. i loved the show when it was on and i'm very much enjoying ago. my sacing fred is one of the friends agains on great shaller. this is a great movie. it is inspirational and wonderful but as starring older senses. why thanks quited. a great series. i think it has all ramei and the discs, or captainy. the case was great and arrived in great condition. i am still in a film of begin. good comedy and it's really great! paig is a wonderful set of that einard'in is out at first in the movie concern, this is no. very good, super and romantic cartoon. still a

('EPOCH : ', 4, ' | TEXT PARTITION : ', 5) follow up with: eat. he plays a little different part in this film. and as always he does well. good story. good action.brand nets. this selm she applay and i enjoyed it very much. anyone that likes his true who still they snefflless. this is one of the great shows without thing olds i was s i oundmo'a know!!! cool girl never seem - older later days. elmo and transacts. great! worth just enjoybeet yourself. very indrvalaning up. have not seen and be able to chrodif on this was an interesting story on mary kenther, kate gifferring parts, great sci-fi kind of purchase. watch it yet sometime! this show had me h

('EPOCH : ', 4, ' | TEXT PARTITION : ', 6) follow up with: of fun. you can't help but smile. just as great as i expected! i love this show,and getting it on dvd. i love all the characters today!! take on movies with boyh, and point you have to say "the action and children" is a great part of the cellicthat band with mess lookant the say is in love at the nonelover one! enimals is sorry it is this episode. one of my favorite movies. i really love this movie. great cast and quality and sound of clore and br. could say immediately to be looking for more!!!!! this is a great small action flick. lots of action, entertainment and comedy! i found i

('EPOCH : ', 4, ' | TEXT PARTITION : ', 7) follow up with: "alien". i like all the twisting of the sub-plots and the visual effects were quite good. this show is simply the best arther the last one & the plots are cute too. other loves that look at a humor. i'm glad i was growing up more than the story that is great but who should understand why we should be anything lesson in those! one of the best seasons! get out better. the recipient was more love in and with some, though it's funny, but very good plus a new character. if you ordered his guys more than you have recently this movie, or mox coublerity, this is one 5 good flick shows. this



At the end of the training you would actually notice that it has started generating very much coherent text and such sentences you will not find in original text file, which we supplied for training.


White Truth

Now you should understand, what Google Microsoft and Facebook are cooking using our conversations made on app like whats app, and Link and Messenger. This is the answer to the question "why are we getting all these services free of cost?"


If you like this tutorial please share with your colleague. Discuss doubts, ask for changes on GitHub. It's free, No charges for anything. Let me to get inspired from your responses and deliver even better.

Never Miss My Post!
bottom of page