(Day 23) Tried making an Natural Language Processing model

Ivan Ivanov · January 24, 2024

Hello :) Today is Day 23!

I wanted to apply what I learned from DeepLearning.AI’s course:

Firstly, the financial statement sentiment classification model

In order to analyze text sentiment, I found data divided into text of its statement on Kaggle.

image

First, I removed stopwords

image

Then I tokenized and padded the text

image

Then created the model (below is the one I ended up publishing in the Kaggle notebook)

image image image

Secondly, the football text generator model

For this one, I gathered data from Wikipedia, and some from ChatGPT about the 2019-2020 Premier League season.

Firstly, I tokenized the text

image

Then I created subphrases based on each sentence

image

For example, I like dogs is I - 1, like - 2, dogs - 3

[[0,0,1],

[0,1,2],

[1,2,3]]

Here I also tried many models, but the final one is below

image

Accuracy:

image

Loss: image

Lastly, I gave it some key words to start from ['Chelsea', 'Manchester United', 'Arsenal', 'Manchester City', 'Tottenham', 'Best team was', 'Against the wall', 'The FA cup was hard but', 'The season was filled with hardships and', 'In the end, the best team was', 'Some teams performed bad, so they were']

and the output for each one:

1. Chelsea amidst a season of transition under the management of club legend frank lampard demonstrated an evolving form in the league
2. Manchester United with flashes of brilliance and frustrating dips in form in the lower ranks added an extra layer of intensity showcasing
3. Arsenal reached the final of the fa cup overcoming formidable opponents including manchester city and chelsea secure a chance to free
4. Manchester City led by the tactical genius of pep guardiola sought to defend their premier league crown with the same possession based
5. Tottenham amazon made a significant impact by broadcasting two rounds of fixtures in december featuring the highly anticipated merseyside derby occasionally
6. Best team was ensure an organized viewing experience games played on the same day were assigned separate time slots preventing overlap and ensuring
7. Against the wall season was characterized by moments of brilliance on the pitch as well as challenges that ultimately impacted city's quest for
8. The FA cup was hard but and son heung min and kane continuing to be standout contributors in attack maintained city's trademark attacking prowess led by
9. The season was filled with hardships and brighton exemplified city's dominance in disarray tournaments success in other competitions and wolverhampton while arteta southampton their modern history of
10. In the end, the best team was a mere sporting event securing eight consecutive wins 24 of which 7 were carried over from the previous season of
11. Some teams performed bad, so they were threats to opposition recognizing that klopp and ultimately brighter days lay ahead for the blues under their legendary manager that

Tomorrow, I will try to make some kind of time-series model


That is all for today!

See you tomorrow :)

Original post in Korean