In [1]:
# find web page with episode descriptions of Ted Lasso
# scrape the page to pull out individual descriptions
# compute polarity score (textblob) of each episode, see how it changed over time
In [2]:
# start with some web scraping practice, before we get to the "real" one
from urllib.request import urlopen
from bs4 import BeautifulSoup
from textblob import TextBlob
In [3]:
# scrape the tiny fake web page
html = urlopen("https://www.khoury.northeastern.edu/home/laney/simple.html")
bs = BeautifulSoup(html.read(), "html.parser")
In [4]:
# what's the h1?
print(bs.h1)
<h1>Header!</h1>
In [5]:
# what's the web page title?
bs.title
Out[5]:
<title>Laney's Fake Web page</title>
In [6]:
# get a list of all the images
imgs = bs.findAll("img")
imgs
Out[6]:
[<img src="https://i0.wp.com/news.northeastern.edu/wp-content/uploads/2022/07/072822_AS_Sarge_001.jpg?w=1400&ssl=1" width="100"/>, <img alt="Cooper, Northeastern's community dog" height="100" src="https://i0.wp.com/news.northeastern.edu/wp-content/uploads/2021/06/062421_MM_cooper_039.jpg?w=1400&ssl=1" width="100"/>, <img alt="Paws, of the Howlin Huskies" src="https://huntnewsnu.com/wp-content/uploads/2014/05/1565016743_c8982ca545_z.jpg" width="100"/>]
In [7]:
# get the content between <p></p> tags
paragraphs = bs.findAll("p")
for p in paragraphs:
print(p.get_text())
Hello I am a paragraph of some content. Content content content. I am the second paragraph, with more information. click here. More content. click here also.
In [8]:
# Get some practice with sentiment score
tb = TextBlob("nice weather today!")
tb.sentiment.polarity
Out[8]:
0.75
In [9]:
# is it using punctuation?
tb = TextBlob("nice weather today")
tb.sentiment.polarity
Out[9]:
0.6
In [10]:
# is it paying attention to a negation?
tb = TextBlob("not very nice weather today")
tb.sentiment.polarity
Out[10]:
-0.23076923076923073
In [11]:
# does it pay attentiont to phrases, and not just individual words
tb = TextBlob("it could have been worse")
tb.sentiment.polarity
Out[11]:
-0.4
In [13]:
# does it keep up with slang? looks like no
tb = TextBlob("that person has rizz")
tb.sentiment.polarity
Out[13]:
0.0
In [15]:
tb = TextBlob("wtf?")
tb.sentiment.polarity
Out[15]:
-0.5
In [16]:
# how does it do with a joking back and forth
tb = TextBlob("so stupid! I'm on the T now")
tb.sentiment.polarity
Out[16]:
-0.9999999999999999
In [17]:
# how does it do with validation from a friend
tb = TextBlob("I know that sounds crazy!")
tb.sentiment.polarity
Out[17]:
-0.75
In [18]:
# lol by itself is positive
tb = TextBlob("lol")
tb.sentiment.polarity
Out[18]:
0.8
In [19]:
# what if we add LOL to an existing text?
tb = TextBlob("that sounds crazy")
tb2 = TextBlob("that sounds crazy lol")
tb.sentiment.polarity, tb2.sentiment.polarity
Out[19]:
(-0.6, 0.10000000000000003)
In [20]:
# let's find out if laney should watch ted lasso over break?
html = urlopen("https://en.wikipedia.org/wiki/Ted_Lasso")
bs = BeautifulSoup(html.read(), "html.parser")
In [22]:
# we found the episode descriptions in <td class = "description" ...>
# so we can use findAll to get tag = td, class = description
descriptions = bs.findAll("td", {"class" : "description"})
for d in descriptions:
print(d.get_text(), "\n")
Recently divorced Rebecca Welton becomes the new owner of the fictional AFC Richmond, a struggling club in the Premier League. To seek revenge on her ex-husband who cheated on her multiple times and was never blamed for it, Rebecca resolves to hire the most incompetent coach she can find to ruin the club, as it was the only thing her ex ever loved. To this end she hires Ted Lasso, a college football coach from Wichita, Kansas. Ted has recently coached an NCAA Division II football team to a title, but knows nothing about soccer. Arriving in Richmond with his assistant, Coach Beard, he tries to connect with his new teammates with his positive, folksy charm, but the club hates him anyway. He is thought of as a rube, but it soon becomes clear he is smarter than he looks. In his apartment at night, he speaks to his son and wife on the phone and hints that he took the job because his wife had wanted "space". On his first day at AFC Richmond, Ted attempts to win over the players and management. He brings Rebecca shortbread as a present; she rebuffs his attempt at friendliness but becomes obsessed with the biscuits. He quickly sees the team has a division in the locker room: Roy Kent, an aging star, is constantly angry and at odds with Jamie Tartt, a young egotistical talent. Seeing that another player, Sam Obisanya, is homesick for Nigeria, Ted throws him a birthday party even though the team had lost a game earlier in the day. Trying to win over Jamie, Ted seeks advice from Keeley, Jamie's model girlfriend. She advises praise, which Ted does. In an attempt to cause more problems for the team, Rebecca has a tabloid photograph of Lasso and Keeley seemingly being intimate with each other, with the intent of enraging Jamie. It is revealed that Ted himself bakes the biscuits he gives Rebecca. Knowing that tabloid newspaper The Sun has photographs of them, Ted and Keeley go to Rebecca. She has their publication stopped, fearful they will be traced back to her, but in exchange, Ted has to spend the day with Trent Crimm, a tough reporter for The Independent. Crimm arrives skeptical. He finds out Ted's new plays were conceived by Nate, the kit man. When Crimm asks him about the appropriateness of throwing Sam's birthday party after the previous week's loss, Ted tells him he's not concerned with wins and losses. Ted, Crimm, and Roy go to a local school event and win over the children. Roy reluctantly but assertively confronts Jamie and a few other players who have been bullying Nate. Ted invites Crimm to dinner, at a restaurant owned by the driver who picked him up at the airport. Ted, never having had Indian food before, gets very spicy food but eats it all to be polite. Crimm's write-up about the "Lasso Way" is positive, enraging Rebecca. The team loses again, prompting Roy and Jamie to fight even more. Rebecca, whilst preparing for the annual charity ball, learns that Robbie Williams canceled on her unexpectedly, so she relies on Higgins to find another musical act. Roy and Jamie constantly feud, setting Keeley on edge. Rupert Mannion, Rebecca's ex-husband, arrives and takes over the auction. Ted, who's trying to control Roy and Jamie's arguments, deduces that Rupert was the one responsible for Robbie Williams canceling in order to embarrass Rebecca. Rebecca later bonds with Keeley, and she convinces Keeley to break up with Jamie. Roy and Jamie make up and resolve not to fight anymore. Rebecca, enraged at Rupert's sudden appearance (and the fact that he donated one million pounds to the charity event to show her up) gets drunk with Keeley, and the two ride off in a rickshaw. Ted provides Higgins with a street performer Ted had encountered earlier to replace the previous musician, and he is met with great reception. Ted's wife, Michelle, and son, Henry, finally arrive, and they have fun together as a family until Ted finds his wife in tears. She confides in him that, although she desperately wishes this was not true, she doesn't love him anymore and has no idea why. She promises to keep trying regardless. Keeley attends a promotion shoot she had organized for Jamie. Rebecca and Roy both seem concerned that Keeley is wasting her time with Jamie, but Keeley reassures them that her relationship with Jamie is over. On the field, Jamie continues to refuse to pass to his teammates and scores goals alone, leading fans and commentators to believe that AFC Richmond is solely reliant on Jamie. Ted sees how bad this is for the team's morale and benches Jamie right before half-time. This is met with harsh criticism from fans. Unfazed, Ted encourages his team to embrace change and believe in themselves. The team works together and manages to break the 2–2 tie to win the match. Ted, Beard, and Nate rejoice with the team. Later that evening, Ted tells Michelle that she does not need to try for his sake to make their marriage work, bidding her and their son farewell. Ted struggles emotionally with the end of his marriage, but is buoyed by Richmond's first win. The press continues to treat Rebecca badly, calling her "Old Rebecca" after Bex, whose full name is also Rebecca, begins dating Rupert, and Jamie and Ted continue to clash over his role with the team. Jamie sees his power weaken when Dani Rojas, a new, enthusiastic player who is just as good as Jamie, joins the team. The two form a rivalry, but Dani gets mysteriously injured, and Ted learns of ghosts haunting the team's treatment room. Ted makes the team sacrifice something special to them to lift the curse, and even Jamie joins in, after inspirational words from Keeley. The next morning, Ted discovers that Jamie has been returned to Manchester City, who had loaned Jamie to AFC Richmond for the season. Dani tries to cheer him up, but nothing happens. AFC Richmond travels to Liverpool for its game against rivals Everton, whom they have been unable to beat for the last sixty years. The game is being held on the weekend of Rebecca and Rupert's wedding anniversary, so Keeley tags along to cheer Rebecca up. They meet Rebecca's old friend Flo "Sassy" Collins, who immediately takes a liking to Ted. That night, Ted, reluctant to sign the divorce papers, gets drunk and snaps at Nate. The next morning, Ted apologizes and asks Nate to share some of his ideas. Nate gives the team an inspiring, if insulting, pre-game speech, and they win the game. That evening, the team goes out to celebrate at a karaoke bar, where Rebecca reveals her beautiful singing voice. Ted tries to enjoy the evening, but suffers a panic attack and stumbles out of the building, where Rebecca finds and comforts him. Ted retreats to his hotel room, where he is visited by Sassy. Roy kisses Keeley, then leaves abruptly. Rebecca entertains a hotel waiter in her room. Ted talks about his troubles concerning Sassy with Beard, Nate, and Higgins, and he nicknames the group the "Diamond Dogs". Keeley asks Roy to go out for coffee but he declines. Later that night, Jamie visits Keeley and she asks him to stay. Keeley later admits to Roy that she slept with Jamie, and Roy talks to Ted, who enlists the help of the Diamond Dogs. They help Roy see another perspective. Ted thanks Rebecca for her help during his first panic attack and offers to help her when she meets other team owners later that afternoon at a pub. There, Rebecca is blindsided by Rupert. In response, Ted makes a wager with Rupert over a game of darts. Ted wins, much to Rebecca's delight. On their way to dinner, Keeley and Roy's kiss is caught on camera by a paparazzo, but Roy forcefully takes the paparazzo's memory card. The next morning in Rebecca's office, Higgins implores her to stop ruining the team and quits. Keeley then storms into the office, having realized Rebecca's plan after finding the picture of her and Ted that was meant to appear in The Sun on the camera card. She threatens to tell Ted if Rebecca does not do it first. Rebecca still has not told Ted about her attempts to sabotage the team, and on the pitch, Roy is showing his age and there are calls to bench him. Ted refuses to do it, alienating him from the others. After Keeley's prompting, Rebecca tries to tell Ted but finds she cannot, and immediately afterward, Rupert comes and tells her he's having a baby with Bex. Rebecca marches down to Ted's office and confesses, and to her surprise, he easily forgives her. Ted tells Roy he is benching him. Roy feels betrayed and goes to Keeley, who tells him he is more than just a footballer. Having been forgiven, Rebecca then seeks out Higgins and apologizes to him. Higgins returns to the club. In the bar, after Ted again states he is not concerned about wins, Beard angrily tells Ted that these are professionals and not student-athletes, and that winning is important to him and the players. Ted finds Roy outside the pub and the two talk. Roy admits his age and they agree that they will claim Roy is injured so as not to embarrass him with a benching. At the next practice, Roy surprises Ted by showing up and donning a second team pinny, accepting his new role while still leading the team as they approach their last match. Nate is promoted to assistant coach, and he shows an inspirational video interview of Jamie, but after Jamie insults the team, they don't watch it, and one of them smashes the screen. Rebecca inspires Ted to cause chaos on the pitch and confuse the other team. In the final match of the season, Manchester City takes the lead of 1–0 in the second half, but Richmond pulls a trick play set-piece and scores to tie up the match; however, it is hopeless as Jamie makes an extra pass to a teammate who scores and wins the game for Manchester City. Consequently, Richmond are relegated to the Championship. Heartbroken by the result and relegation, Ted attempts to cheer everyone up with some advice he offered Sam earlier in the season, and that together they will get through it. Coach Beard brings Jamie an envelope from Ted with a letter congratulating him for the extra pass and a toy soldier to look after him, having seen his father berate him for not scoring. Meeting with Rebecca the next morning, Ted attempts to resign, but she rebuffs him; instead, together they decide to win promotion next season, and then to win the Premier League once they are back. The episode starts midseason, as Richmond has drawn their last seven games. Dani prepares to kick a game winning penalty, but he accidentally kills Richmond's greyhound mascot Earl; his resulting guilt cripples his ability to play. To help Dani recover from his "yips", Richmond hires sports psychologist Sharon Fieldstone, whose stern and disciplined attitude clashes with Ted. After meeting with Sharon, Dani regains his enthusiasm for football and converts a corner kick goal in practice. As a result, more players begin to request sessions with Sharon. Meanwhile, a newly retired Roy is coaching an Under 9 Girls Football team and dating Keeley. Jamie is shown to be a contestant on Lust Conquers All, a Love Island-style reality show. Jamie is voted out of Lust Conquers All, leading him to unsuccessfully attempt a return to Manchester City. Higgins hires Sharon for the rest of the season. Jamie approaches Ted to rejoin Richmond and reveals that he left Manchester City to anger his abusive father. Ted politely declines his request to rejoin. When a picture of their conversation goes viral, Sam believes Jamie, who repeatedly bullied him, is returning and angrily storms off during practice. Ted assures Sam that he said no. After the girls' team Roy coaches lose their championship, Keeley convinces Roy to try out a pundit job at Sky Sports. Despite his heavy cursing drawing the disapproval of his other pundits, Roy's commentary is positively received by the public and the network asks him to return. Wanting to give Jamie a second chance, Ted reconsiders adding him to the team and polls the Diamond Dogs on their opinions. Higgins votes for the addition, while Beard and Nate vote against it. Roy admits to Keeley that he enjoyed being on the show. Jamie rejoins Richmond, to the players' confusion. The team does not take kindly to Jamie's return, despite his attempts to apologize for his past behavior. On Keeley's advice, Jamie visits Sharon. Sassy's daughter (and Rebecca's goddaughter) Nora comes to visit, and spends a day with Rebecca at work. Sam participates in a photoshoot for Dubai Air, the team's sponsor, but later learns from his father that Dubai Air is owned by an oil company polluting his home country of Nigeria. He withdraws from the ad campaign, prompting pressure on Rebecca from Dubai Air to fire Sam, but she holds firm at Nora's urging. During Richmond's next game, Sam and fellow Nigerian players Isaac and Winchester cover their uniforms' Dubai Air logos with tape in protest; Jamie leads the rest of the team to follow suit. Ted lets Sam speak about Dubai Air's malfeasance and the Nigerian government's corruption during the postgame press conference. Jamie toasts Sam for his courage, and the two reconcile. During Christmas, Ted unsuccessfully tries to spend time over the phone with Henry and Michelle, and becomes dejected and starts drinking afterwards. Rebecca, suspecting Ted would feel alone in his first post-divorce Christmas, brings him along to give gifts to underprivileged children across town. Roy and Keeley learn Phoebe's classmate is bullying her for bad breath; they trace the problem to the antihistamine she takes for a cat allergy, and take Phoebe to make amends with her bully using handwritten notes. Higgins and his family host a Christmas party for foreign players who are unable to visit their families at home. Ted and Rebecca join the party, performing Christmas (Baby Please Come Home) with a street band they gave money to earlier on the road outside the Higgins' house. Nate timidly tries and fails to book a window seat at his parents' favorite restaurant for their anniversary. After Rebecca and Keeley teach Nate to be more assertive and confident, he successfully obtains the window reservation. Rebecca becomes interested in her new match on Bantr, an anonymous dating app co-owned by Keeley and sponsoring Richmond. Richmond continues to struggle, in part due to team captain Isaac's anxiety hampering his leadership. Roy helps him by taking him and Ted to a field near his childhood home and having Isaac play a pickup match with neighborhood footballers, reminding him to have fun while playing. While commentating on his Soccer Saturday show, Roy watches a newly enthusiastic Isaac on the pitch and realizes he misses being involved with the game. He abruptly leaves the broadcast and makes his way to Richmond's stadium, where he joins Ted's coaching staff, to the applause of the Richmond supporters and Nate's chagrin. Rebecca is visited by her mother, who recently left her father; Rebecca tells Ted that her parents repeatedly separate and reconcile every few years. Beard and Jane get back together; Higgins is advised by Ted and Roy not to voice his apprehensions. Richmond enjoys newfound success with Roy on the coaching staff. Jamie is upset that Roy refuses to give him coaching advice; Roy eventually relents and tells Jamie he needs to occasionally play more aggressively, telling him the coaches will provide him a signal for when to do so. While in a close game against Tottenham Hotspur in the quarter-final of the FA Cup, all four coaches give Jamie the signal - raising their middle finger at him - leading to him scoring a goal. Ted suddenly has a panic attack and leaves the pitch; with Richmond in disarray, Spurs score. Without Ted, Nate steps in and calls a triple substitution that leads to a game-winning score for Richmond. Sharon finds Ted in her office asking for help. Ted's first two sessions with Sharon prove fruitless: he leaves the first almost immediately, and storms out of the second after expressing his skepticism and contempt towards psychotherapy after couples therapy failed to save his marriage. During the third visit, however, Ted apologizes for his outburst and decides to commit to the therapy process. Roy unwittingly begins spending every moment he can with Keeley, to the point where she feels smothered; the two fight after Roy learns that Keeley has been complaining about his overbearing behavior to Rebecca and others. Thanks to Jamie, Roy later comes to understand that Keeley needs space, and makes amends by running her a candlelit rose bath to enjoy alone in their home. Nate sees himself going viral on Twitter for the triple-substitution that resulted in Richmond's recent win, but his insecurity worsens when his stern father advises humility instead of praising his achievement. As a result, Nate begins behaving cruelly to others in the locker room – first to Colin, a young Welsh player who used to bully him, and later to Will, the new kit man. Sharon suffers a concussion after being hit by a car while biking; Ted brings her home from the hospital. Rebecca and Sam anonymously arrange a dinner date, and find out upon arriving at the restaurant that they are each other's Bantr matches. Rebecca is initially apprehensive, but Sam convinces her to have dinner with him platonically, which they both enjoy. The two kiss when they return to Rebecca's house, but agree not to escalate the relationship further. Roy is called in to Phoebe's school and realizes that his swearing is having an effect on her. Richmond plays at Wembley Stadium for the first time against Manchester City, but suffers a harsh loss. After the game, Jamie is bullied over the loss by his father in the locker room in front of his teammates and coaches. Jamie finally retaliates and strikes his father, whom Beard escorts out; Roy embraces Jamie, who breaks down crying in his arms. The scene shakes Ted into calling Sharon and confessing that his father died by suicide when Ted was 16. Rebecca and Sam ultimately spend the night together. The night of Richmond's loss against Manchester City, a dispirited Beard visits a pub and is joined by avid Richmond supporters Baz, Jeremy and Paul. The four later sneak into a speakeasy, but Beard is thrown out after tearing his pants. He accompanies Mary, a woman he met at the club, back to her apartment, but is soon forced to flee from Mary's hulking boyfriend Darren. Beard is soon cornered and beaten in the street by Jamie's father and his friends, but Darren saves him, having followed him to return Beard's wallet and phone. Beard is horrified to find a string of angry texts from Jane. Baz, Jeremy and Paul take him home in a limo they bought while gambling at the speakeasy, and Beard thanks them by showing them a secret entrance to Richmond's home stadium. Beard is unable to enter his home after his key breaks, and stumbles into a secret nightclub beneath a church where he and Jane enjoy a night of dancing. The next morning, a sleep-deprived Beard returns to work as usual with his fellow coaches. Rebecca and Sam continue their relationship in secret for several weeks. One morning, Rebecca's mother informs her that her father has died. The entire Richmond team attends the funeral, but Ted has a panic attack and calls Sharon for a therapy session. Rupert and Bex come to the funeral uninvited with their newborn daughter, infuriating Rebecca. Keeley and Sassy deduce that Rebecca is secretly in a relationship, and Keeley correctly guesses it is with Sam. Rebecca tells her mother she does not want to eulogize her father, as she had watched him cheat on her mother when she was a child, but her mother reveals that she knew and loved him despite his imperfections. At the same time, Ted describes his father's death by suicide to Sharon for the first time, and arrives late for the funeral. Instead of giving a traditional eulogy, Rebecca leads the mourners in singing "Never Gonna Give You Up", a song that her parents continued to like and find meaningful. After the service, Jamie admits to Keeley that he loves her. Rupert tells Rebecca he will give her the remaining shares of Richmond and briefly converses with Nate. Rebecca ends her relationship with Sam, fearing heartbreak, but grows closer to her mother. Sam scores the first hat-trick of his career. Ghanaian billionaire Edwin Akufo visits Richmond and informs Rebecca that he wants to buy Sam as a player. Akufo elaborates to Sam that he wants to buy Raja Casablanca and sign an ensemble of Africa's most talented players. Sam is given three days to consider the offer, though Rebecca pleads with him not to go. Nate continues to feel the frustration of receiving little credit for developing the team's tactics; while trying on new suits, he impulsively kisses Keeley. During Roy and Keeley's photoshoot for the latter's magazine profile, Keeley admits Nate's kiss and Jamie's confession of love at the funeral, and Roy tells her he spent 3 hours with Phoebe's teacher, leaving both shaken. Ted learns that Sharon left before her last day, and he tracks her down to give her the team's parting gift. Later, Ted receives a text message from Trent Crimm tipping him off about a forthcoming article on Ted's matchday panic attack and that Nate was his anonymous source. Ted receives the club's full support after the news of his panic attack. He focuses on the season's final match, which would determine Richmond's promotion into the Premier League. At halftime during the match, Nate tries to abandon his false 9 tactic, but the players elect to stick with it. Ted asks Nate why he is upset with him. Nate angrily responds that Ted has continuously neglected him since joining the coaching staff. Dani scores an equalizing penalty to secure Richmond's promotion. The team and supporters celebrate, but Nate walks off dejected. Sam decides to stay at Richmond, to Akufo's fury, telling Rebecca it would be best for his own personal journey. Ted runs into Trent Crimm, who was fired as a reporter after revealing his anonymous source. Keeley learns Bantr's VC wants to finance her own PR firm. She and Rebecca discover Rupert bought West Ham United. Roy forgives Jamie and Nate for sharing their affections with Keeley but worries she will leave him. Two months later, Rupert greets the newest member of his West Ham coaching staff: Nate. Richmond is projected to finish in last place for the new Premier League season, while West Ham is expected to be in the top four. The forecast demoralizes the team; to lift their spirits, Ted gives them a tour of London's sewer system to teach them a lesson about relying on one another amidst hardship. Photos of the team entering the sewer go viral; Nate mocks the team and Ted during a press conference arranged by Rupert, but Ted responds during his own press conference with self-deprecating jokes that charm the reporters. Roy and Keeley inform Phoebe that they are breaking up, as Roy's increased coaching responsibilities and Keeley's busy job running her new PR firm give them little time together, but Keeley suggests there are deeper problems in their relationship. Over the phone, Ted's son Henry shows him a toy that his mother's "friend" Jake bought him, unsettling Ted. Trent Crimm begins visiting Richmond to write a book about the club, but Roy forbids the players from talking to him, still bitter over a scathing article Trent wrote about Roy during his debut for Chelsea as a teenager. Roy eventually reconciles with Trent at Ted's urging. Keeley struggles to lead her PR firm and hires her inexperienced model friend Shandy, frustrating her CFO Barbara. Zava, a renowned but arrogant footballer, is in high demand after leaving Juventus F.C. Upon learning Rupert wants to sign him, Rebecca finds Zava in the bathroom during a Richmond match against Chelsea and harshly tells him that joining West Ham would surrender him to mediocrity. This inspires Zava to sign with Richmond. Roy reminisces to Ted and Trent about his career with Chelsea, realizing he never allowed himself to enjoy the sport. Richmond enjoys an unprecedented five-game winning streak with Zava on the team, culminating in a win away at Old Trafford against Manchester United. Sam takes the team to celebrate at his yet-to-open Nigerian restaurant, Ola's. Ted is disturbed to learn that his ex-wife Michelle is dating their former couple's therapist, Dr. Jacob; both Sharon and Sassy validate his concern that it is an ethical violation. Jamie feels overshadowed by Zava's stardom; Roy offers to train him. Rebecca visits her mother's psychic Tish, who tells her she will one day be a mother; Rebecca angrily rebuffs Tish as a fraud, but is later stunned when Sam hands her one of the green matchbooks he is giving out to the team, in line with one of Tish's premonitions. Colin introduces his boyfriend Michael to the team as just a friend, but Trent spots them kissing in private while leaving the restaurant. Ted asks Sassy out on a date, but she declines, telling him that he, like her, is a "mess" and that they are better off remaining friends with benefits. Keeley meets Jack, the woman running the VC company that invested in her PR firm. Richmond prepares for their much-anticipated match against West Ham, with Ted and Nate not having seen each other since the latter's acrimonious departure from Richmond. Unbeknownst to Ted, Nate privately regrets the way he left Richmond, but Rupert tells Nate to quash his concerns. Trent uncovers camera footage of Nate tearing Ted's "Believe" sign in half, which Beard and Roy use to rile up the team against West Ham, but Richmond's aggressive play in the second half of the match results in three red cards and ultimately a heavy loss. Rebecca notices Rupert flirting with his assistant after the match and tells him to stop. Ted calls Michelle to voice his concerns about her relationship with Dr. Jacob. Richmond suffers a seven-game winless streak since their loss to West Ham. Rebecca visits a fertility clinic after noticing another of Tish's premonitions coming true, but learns that she is no longer fertile. Ted learns his son got in trouble for bullying another student, but is reassured when Henry shows remorse. Keeley fires Shandy after her antics lead to the firm losing a client. She and Jack grow closer and end up getting drunk and having sex in the office. Nate takes a famous model on a date to A Taste of Athens, his favorite restaurant, but she leaves out of disinterest; Nate later bonds with waitress Jade. Zava fails to show for the Manchester City game forcing the team to play without him, which they ultimately lose. Following the game Zava announces his retirement, leading Ted to make a speech suggesting Zava's departure will benefit the team as it will encourage them to regain their belief in themselves. After losing a friendly against AFC Ajax in Amsterdam, Ted declares no team curfew in order to lift Richmond's spirits. Keeley leaves for Norway to see the aurora borealis with Jack. Higgins and Will go to a jazz club in the red light district. Roy immediately pushes Jamie to start training; after tiring out Roy by leading him on a tour of the city, Jamie teaches him how to ride a bicycle. Rebecca is accidentally knocked off a bridge into a canal and spends the night with a man on a houseboat. Colin heads out to a gay bar where Trent finds him and relates his own struggles with coming out. The rest of the team argue trying to decide where to go that night, and end up staying at the hotel to have a pillow fight. Coach Beard gives drugs to Ted before heading out to perform as "Piggy Stardust". While watching an old Chicago Bulls game at an American restaurant, Ted has a vision that inspires him to create a new strategy inadvertently based on Total Football. The next morning the whole team leaves Amsterdam energized and their morale boosted. Ted, Beard, and Roy begin to introduce Total Football to the team with a series of training exercises. Attempting the strategy in a game against Arsenal F.C., they fall behind 3–0 in the first half, but after a pep talk from Jamie they come together to score an elegant goal in the second half, convincing Trent that Ted's supportive style of coaching will succeed. Nate works up the courage to ask Jade on a date. Rebecca expresses concern that Jack is love-bombing Keeley with extravagant gifts, and so Keeley tells Jack she wants their relationship to be on more equal terms. Just before his father is to visit, Sam criticizes a bigoted Cabinet minister on Twitter, and the next day his restaurant is vandalized by the minister's supporters; when he brings his father to see the wreckage he finds the whole team there, cleaning and repairing the restaurant. Michelle, Dr. Jacob and Henry visit Ted in London. Ted is unsettled to learn Michelle is going to Paris with Dr. Jacob, whom he suspects wants to propose to her. He asks Rebecca's help in investigating the matter, but Rebecca convinces him to let it go and enjoy the time he gets to spend with Henry. Ted, Beard and Henry attend a West Ham game; Nate is privately pleased to see them. Keeley is horrified to discover that a sexually explicit video of her has leaked online. Jack, hoping to preserve her reputation among her wealthy friend circle, has lawyers draft an apology for Keeley to read; Keeley refuses, prompting an argument with Jack. Jamie then visits her and apologizes for failing to delete an email containing Keeley's leaked video, which she sent to him while they dated; the two share a hug. Isaac discovers Colin is gay when the team agrees to erase all explicit photos of ex-partners. Michelle returns from Paris, and Ted notices she is not wearing a ring. Isaac is left troubled after finding out Colin is gay, and it strains the friendship between the two men. After a poor showing by Richmond in the first half of a match against Brighton, a Richmond fan uses "the other F-word" to insult the team, causing Isaac to attack the fan and receive a red card as punishment, though the fan is also kicked out. In the locker room Colin comes out to the rest of the team and they accept his sexuality. Richmond wins the match and Colin posts a season best performance. Rupert is introduced to Jade by Nate, but after inviting him out for a "guys night out" Nate makes an excuse and leaves when he realizes Rupert has purposely invited two women to join them. Isaac later visits Colin at his home and reveals that he was disappointed that Colin hadn't come out to him earlier, though Colin explains that he was scared that Isaac would reject him and Isaac admits that he would not have been able to keep it a secret anyway. Colin invites Isaac inside and the two bond again as friends over some games of FIFA. Nate unexpectedly quits West Ham and recuperates at his parents' house, where he mends his strained relationship with his father. He later leaves Will an apology note in the locker room for his past behavior. Several Richmond players are selected to play for their national teams; Sam is disappointed to not be selected for Nigeria, only to learn Edwin Akufo bribed officials to keep him off of the team out of spite. Rupert recruits Rebecca to join Akufo's exclusive Super League, but Rebecca berates Akufo and the other team owners for taking football away from working-class people out of greed, and sways them into rejecting Akufo's plan. A moved Rupert tries to kiss Rebecca afterwards; she rejects him, but realizes she has overcome her resentment towards him. Keeley learns that funding for her firm has been pulled, but Rebecca invests in the firm to keep it running. Roy apologizes to Keeley for ending their relationship, and they sleep together. Ted's mother Dottie unexpectedly arrives in London, making Ted anxious. Nate begins working at A Taste of Athens; Will and the players ask him to return to Richmond, but he turns them down. The team plays against Manchester City once again. Jamie is debilitated by his anxiety over returning to his hometown, expecting his father to be at the game, and brings Roy and Keeley to his mother's house; Jamie's mother comforts him. At the game, Ted suggests to Jamie that he forgive his father for his own sake, helping Jamie regain the confidence to seal a victory for Richmond. Jamie's father watches the game from rehab and cheers him on. Ted later convinces Beard, the only holdout against Nate's return, to let him return; Beard visits Nate and reveals Ted helped him when he was at his lowest point, and returns the favor by forgiving Nate and offering him a job with the club. Ted admits to Dottie he resented her for not resolving her grief over his father's death, and the two reconcile; she tells him his son misses him. Richmond can win the league if they win against West Ham and Manchester City loses or draws their final game. News hits that Bex is divorcing Rupert over his infidelities. Ted has informed Rebecca that he and Coach Beard will be going home. Rebecca considers selling the club. Nate becomes assistant kit man under Will; he later tearfully apologizes to Ted. Trent gives Ted and Beard a draft of his book. Roy and Jamie fight over who gets to be with Keeley, but she turns them both away. During the game West Ham takes a two goal lead; at half time the players reveal they all have pieces of the "Believe" sign and they put it together before returning to the pitch. Richmond equalize the score. Rupert assaults the new West Ham manager and gets jeered. Sam scores the winning goal and Richmond finishes second in the league. After Rebecca farewells Ted at the airport, she runs into the man from the houseboat in Amsterdam. Beard stays in England and marries Jane. Roy becomes Richmond's manager and starts sessions with Dr. Sharon. Ted asks Trent to change the book's title, The Lasso Way, because it was never about him; Trent retitles it The Richmond Way. Beard, Roy and Nate put the "Believe" sign back up. Ted returns home and coaches his son's soccer team.
In [23]:
len(descriptions)
Out[23]:
34
In [24]:
# compute the polarity score of every episode so far
pols = []
for d in descriptions:
tb = TextBlob(d.get_text())
pols.append(tb.sentiment.polarity)
pols
Out[24]:
[0.10384615384615385, 0.11217948717948717, -0.044065656565656565, 0.052777777777777785, 0.021071428571428585, 0.21382189239332097, -0.08593750000000001, 0.06458333333333334, 0.08672438672438673, 0.1138888888888889, 0.20606060606060606, -0.08863636363636362, -0.04166666666666668, -0.16785714285714284, 0.17045454545454544, 0.022222222222222216, 0.09289772727272727, -0.1254273504273504, -0.11538461538461539, -0.020833333333333332, 0.1459505772005772, 0.19642857142857142, 0.04852272727272726, -0.10400000000000001, 0.14545454545454548, -0.05277777777777778, -0.11153846153846152, 0.15233585858585857, 0.10111111111111111, 0.30238095238095236, 0.00468749999999999, -0.10833333333333334, -0.17055555555555557, 0.08080808080808081]
In [30]:
# plot the polarity scores over time
import matplotlib.pyplot as plt
plt.plot(pols, color = "pink")
plt.axhline(sum(pols) / len(pols), color = "black")
plt.ylabel("Polarity Score")
plt.xlabel("Episode Number")
plt.title("Ted Lasso Sentiment Scores Over Time")
plt.ylim(-1, 1)
Out[30]:
(-1.0, 1.0)