1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("ahmedHamdi/ir-es-en-instructor-xl")
5# Run inference
6sentences = [
7 'Represent the plot: A group of taxi drivers, calling themselves "the family," dedicate themselves to cleaning up the city of Madrid of Black people ("shit"), homosexuals, transsexuals, and transvestites ("fish"), and drug addicts ("meat") during their nightly patrols. One of them, Velasco, has a daughter, Paz, who has failed her exams and decided to drop out of school. Angry, Velasco forces her to work with him in the taxi: she drives during the day, and he drives at night. Dani is the son of a family member: Reme. He hadn\'t seen Paz since they were children, and now they fall in love and start dating. In one scene of the film, the family, along with Dani and Paz, visit Reme\'s husband in the hospital: a retired taxi driver who was paralyzed after being shot in the spinal cord by a couple of drug addicts. He survived thanks to one of the family members, Calero, a taxi driver and former police officer, who happened to be passing by. That was the reason the group decided to wage their own personal battle, and Dani is almost convinced he has to do the same. Little by little, Paz learns about the escapades of her boyfriend, her father, and his friends, something she vehemently disapproves of. It is then that the ex-policeman sees her as a threat, and fearing she will report them, decides to kill her.',
8 "Represent the plot: After failing one of her midterm exams in a Madrid high school, Paz Velasco decides to drop out of the academic circuit. She takes this prompt decision much to the chagrin of her father, an overbearing taxi driver. In exchange, he forces her to join him at work so she can learn the trade and earn a living. Her reconnection with the so-called Family, the close-knit group of her father's co-workers, is initially uneventful. One of its members is Dani, Paz's childhood sweetheart and a young taxi apprentice about to be discharged from the military service. Upon meeting for the first time in many years, they rekindle their mutual attraction and start dating, much to the apparent satisfaction of Dani's mother Reme—a fellow cabbie who is having a secret affair with Paz's father. Reme's husband is a former taxi driver who, according to the explanations given to Paz, was shot by two drug dealers during a robbery. One of the shots left him paralyzed and the Family's visits to him in the hospital are a staple in their common social life. Aside from Dani, Velasco and Reme, this group is completed by a shady individual named Calero and a thuggish brute nicknamed Niño who seems to act as an informal henchman of sorts for the former. Paz realizes Calero is a former cop even before being told so, and their mutual distrust is vivid and ever-increasing throughout the film. From the outset, it is made clear to the audience that the Family is in fact a neo-fascist death squad whose members use their cabs to abduct non-white, immigrant, LGTB and drug-addicted customers with murderous intent. There is also some evidence of rudimentary tactics, e.g. using code words for each kind of victim in order to lure unwitting victims to the killing box. Dani has been recently groomed into the group and partakes in their activities, although it is made apparent to the audience that he does so reluctantly. The Family seems to be generally successful in its exploits: two murders are shown on-screen, as well as a raid on a Moroccan camp during which Dani accidentally kills a man. The film does show, however, one botched attack during which the victim manages to run away unharmed. It is left unclear whether or not the group is restricted to the core members shown onscreen. It is also left unclear whether the group's activities were prompted by the attack that crippled Dani's father or it was just a casual event that fuelled them further, or whether the version given to Paz was a lie and the attack was a direct result of the group's illegal pursuits. Their activities are spontaneous and seemingly not officially sanctioned, but there are ominous references by Calero to people up there who know and approve of the group's activities, leaving the door open to speculation on a wider conspiracy. Although initially ignorant of the actions and general demeanour of the Family, Paz gradually finds out the truth through a series of details and coincidences, such as a profusion of fascist and pre-democratic antics and regalia, purportedly intimate family reunions attracting skinheads and other sinister individuals and ending in massive Roman salutes, casual bigoted remarks from her father and Dani (as well as the latter's violent outburst on a black street vendor) and a disturbing pattern of codenames or labels directed at different collectivities. Paz's unassuming and long-suffering mother seems increasingly distraught at the prospect of having Dani close to her daughter, and although Paz initially blames this on his general lack of education and ambition, it becomes increasingly clear that her mother knows more than she says about him and the whole group. Once confronted with the evidence, her disgust and adamant disapproval set up a chain of events leading to the climax. The paranoid and increasingly unstable Calero, who saw her as a potential liability to the group from the very beginning, now wishes to silence Paz at all costs. He shoots (and presumably kills) her father when he tries to stop him, and confronts her and Dani in the Retiro Park, shooting Dani, and being shot to death by Paz seconds before he is about to finish him off. The camera pans over the park as she walks away with the injured Dani, and credits roll. The fate of the rest of the group is left undisclosed.",
9 "Represent the plot: The film outlines the daily life of a punk named Stevo in Salt Lake City, Utah, in the fall of 1985. Stevo's best friend, Heroin Bob, is also a punk. The nickname Heroin is ironic, as Bob is afraid of needles and actually believes that any drug (with the notable exception of alcohol and cigarettes) is inherently dangerous. Stevo and Bob go from party to party while living in a dilapidated apartment. They spend much of their time fighting with members of other subcultures, particularly rednecks. Stevo has a casual relationship with a girl named Sandy, while Bob is in love with Trish, the owner of a head shop. The two of them are shaped by their experiences with their parents. Stevo's parents, now divorced, are former hippies who are proud of their youthful endeavors; however, Stevo is revolted by what he perceives as their selling out by becoming affluent Reagan Republicans, which they try to justify. Stevo's grades are excellent, and when his father sends an application to Harvard Law School and Stevo is accepted, he nevertheless rejects it because of his beliefs. By contrast, Bob's father is a mentally ill alcoholic who mistakes his son and his friend for Central Intelligence Agency operatives and chases them away with a shotgun when they visit him on his birthday. Stevo begins to see the drawbacks of living the punk life. Sean, a fellow punk, was a drug dealer who once attempted to stab his mother while under the influence of an entire 100-dose sheet of acid; in the present, Stevo finds him panhandling on the street with some obvious mental issues. While Stevo understands that his relationship with Sandy is casual, he is still enraged when he discovers her having sex with another man and savagely beats him, later loathing himself because his action contradicts his own belief in anarchism. His social circle also begins to drift away, as his dealer, Mark, and his friend, Mike, both leave Salt Lake City (Mark to return to Miami, Mike to attend the University of Notre Dame). Soon after, Stevo attends a party and falls in love with a rich girl named Brandy, who points out that his clothing and hair are fashion as opposed to true rebellion. Rather than being offended, Stevo takes the criticism thoughtfully, and they passionately kiss. At the same party, Bob complains of a headache (induced by Spandau Ballet's She Loved Like Diamond playing on a stereo), and is given Percodan, which he consumes with alcohol after being told the pills are simply vitamins that will help his headache. The accidental drug overdose kills him in his sleep. When Stevo discovers Bob's body, he breaks down completely. At the funeral, he appears with a shaved head and changed clothing, having decided he is done with being a punk. He plans to go to Harvard, and earlier narration suggests that he eventually marries Brandy. He notes in his closing narration that his youthful self would probably kick his future self's ass, wryly describing himself as having been ultimately just another poser.",
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 768]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities)
18# tensor([[1.0000, 0.6338, 0.2186],
19# [0.6338, 1.0000, 0.1956],
20# [0.2186, 0.1956, 1.0000]])