Data-310-Public-Raposo

Data 310 project summaries

View the Project on GitHub aeraposo/Data-310-Public-Raposo

Romeo: Thou jests with NLP? Juliet: ‘tis true! (7.29.20 Class Exercise)

Using NLP to build a sarcasm classifier:

✅[1.3710256e-08] = ~0 - “The child-care industry is on the brink of collapse. Congress must rescue it.” (Washington Post)
✅[2.8298592e-07] = ~0 - “Protests live updates: NYPD facing questions as demonstrations continue.” (Washington Post)
✅[3.2580751e-01] = ~0 - “US announces plans to remove 12,000 troops from Germany, with half coming home.” (Fox News)
✅[7.1725477e-03] = ~0 - “Justice Department to expand federal law enforcement presence in Midwestern cities.” (POLITICO)
✅[5.6891394e-09] = ~0 - “These Microbes May Have Survived 100 Million Years Beneath the Seafloor.” (The New York Times)
❌[1.5391873e-07] = ~0 - “Trump’s Summer of Love Is a Distant Memory Now.” (POLITICO)
✅[9.9453628e-01] = ~1 - “Michael Goodwin: Barr eats Nadler’s lunch during testimony.” (Fox News)
❌[1.6046785e-07] = ~0 - “A Republican Panic Button.” (The New York Times)
✅[8.8728958e-01] = ~1 - “Why You’ll See Two Figures for G.D.P. Decline: Very Big, and Huge.” (The New York Times)
❌[2.1694852e-05] = ~0 - “Joe Biden takes a non-virtual moment to muse on his basement, apocalyptic ads and being Trump’s ‘antithesis’.” (The Washington Post)

Not too bad! The training and testing scores showed that the model became overfit so these mixed results were expected (likely due to the very large vocabulary). Particularly model had a had time identifying sarcastic headlines but the cases that were missed are not super obvious; if I didn’t know the contexts, I would probably label them as not sarcastic too (I’m actually questioning if the ones it counted as not sarcastic really are, I’m really bad at picking up on sarcasm).

Text generation with an RNN:

Round 1:

ROMEO: he had Slatue upon the fine of the town? KING EDWARD IV: Well, villain,–For no pluck HORSET: Most gracious knigeth hath might repuse his rage So much greater hour tideness me? Paging: My lord, she’s not come to my mistress. Thou letters he not, too much? He apry to look upon thy hand than hated? Thought will repair at me, resembly nor that ended this: Some that at the tomach lies that bred that ends On years, methoughts to maintain my schooly sprending tale, And all hever ribn’d ad in the trumpets, This world good namen o’ the first, to make Our city canst not right; Henry, all cold, kinsman. Feaths, take it you stuck That hath given him the place against thy prince, Hast thine boing with thinesell before thee. Jost? Durse: The cause of fraificiness that seest to see, And his confell’d is! Here did we percution their heart that offended voice Wor brows not. First Stander. Lords, twice or a poor soul. You beheld, it were as help to give: what company, now I tell you kiss, consunti

Round 2:

ROMEO: I would I hope his word: ‘tis already: Those wits, laid Beneminius; Left behind. DUCHESS OF YORK: O making, very, taility, for my butt, consent, As seeketh good as free frown, tormentaclion the fine marriage From thy dear to strike upon’t a sign the heart’s give was night, And we will be dlad rue by banishment, That they no carck of tast it offended or thy life, And, but your good due news cry ‘trumzeth, ladies flies begins to me: But Officer of the murdeit profort up: And I hope by rather, and you sit Then are crALINGBROKE: That’s my barrities, for thee. Farewell, you’re, unwill I give; for him Do you before I cannot that. LEONTES: They not round be raged. FLORIZEL: Here I be called my pare. If you call conspiracle my mast before The best is worse and time from on. TRANIO: A place; Which Hapting pendly-born: Duke, fair! O, the nobles home, cries Juliet. Second Servingman: I have not toe touch their header than he was busts A suffortune ears or peeting pirtued words; And would you

Neural machine translation with attention:

Spanish: hace mucho frio aqui.
Predicted translation: it s very cold here.

Spanish: esta es mi vida.
Predicted translation: this is my life.

Spanish: ¿todavia estan en casa?
Predicted translation: are you still at home?

Spanish: trata de averiguarlo.
Predicted translation: try to figure it out.

Attention weights