Inspiration and Intention
As a foreigner, when I talk with people in English, it’s sometimes a little bit embarrassing. Like when people ask me:”How’s going?” I’m always not if I should answer like “good”/”fine”, or answer it with more details or emotions to show my respect – cuz in China, people never greet by asking questions.
So we are wondering if we can build up a specific structure for questions and answers, based on different people’s styles.
What We Do
- Select the most frequently-used words quoted from various celebrities from https://www.brainyquote.com/;
- Based on our source texts, re-construct the words and generate different questions;
- Answer these special-style-questions with a fixed structure.
Techniques We Use
Full github repo here: https://github.com/HereIsJade/RWET-hw/tree/master/final
First, I use the python library Selenium for web browser automation and scrapping from https://www.brainyquote.com/. To prepare for text manipulations, I save each celebrity’s quotes in a txt file.
For the text manipulation part, we basically use Spacy to extract part-of-speech tags and construct the new sentence in a certain grammar structure. We use five lists to store nouns, verbs, adjectives, adverbs, and pronouns. The structure of a question goes like this: “What if”+ adj + noun + verb + adv + adj + pron + verb + adv. And the answer is a simple sentence consists of adj + noun + verb + adj + noun.
To enable user queries for generating arbitrary celebrity quotes, we use Flask to host a web page.
Examples We’ve Got