Skip to content
from translate import Translator
articol = """"
În cursul nopţii de joi spre vineri, poliţiştii ieşeni au fost sesizaţi despre existenţa unui cadavru în zona gării din oraş.Anchetatorii s-au deplasat la faţa locului unde informaţia s-a confirmat şi au început cercetările.Din primele informaţii, victima, o femeie, ar fi fost omorâtă în bătaie de fiul ei, care i-ar fi abandonat apoi corpul. Suspectul ar fi fost identificat, dar nu a fost audiat până la acest moment (vineri la prânz). În cauză s-a întocmit dosar pentru infracţiunea de omor.
"""
from transformers import pipeline

summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
def rezumat_articol(articol):
    translator=Translator(from_lang='ro',to_lang='en')
    articol_tradus=translator.translate(articol)
    rezumat_engleza=summarizer(articol_tradus, max_length=100, min_length=10, do_sample=False)
    rezumat_romana=traducere(rezumat_engleza[0]['summary_text'],'en','ro')
    return rezumat_romana
rezumat_articol(articol_tradus)
ARTICLE1 = """ 
More than 85,000 people tried to buy tickets for comedian Michael McIntyre's show at a theatre with just 110 seats.

The Old Town Hall in Hemel Hempstead, Hertfordshire, said its online box office was "overwhelmed" when the £15 tickets went on sale on Monday.

All tickets for the show next Tuesday sold in under five minutes, it added.

The star of the Big Show and The Wheel on BBC One is doing a series of warm-up gigs to try out new material ahead of his world tour.

The theatre said all 110 tickets were being held in online baskets within 10 seconds of the show going on sale at noon.

The Old Town Hall, Hemel Hempstead
The Old Town Hall said its box office was "overwhelmed" with fans trying to obtain tickets
"We have been overwhelmed with the response from customers wanting to book tickets to see Michael McIntyre and only a lucky few managed it," it added.

It said the comedian's booking was a "huge success" for the venue, which had "even more big named comedians and acts to come".

"""
ARTICLE2= """"
In the last few years, heckling has taken on a new life. We’ve all seen the tiktoks and reels. COMEDIAN DESTROYS HECKLER. COMIC OWNS DRUNK AUDIENCE MEMBER. 

It’s great content, but it normalized heckling. Which is, like everything else, the algorithm’s fault. Don’t blame the comics, they’re just getting their bag.

I’ve dealt with a few hecklers, but every time it shakes me, and I bomb the rest of the set. Heckling doesn’t seem like it’s going away any time soon, so I’ve got to learn how to deal with hecklers.

I need to thicken my skin and fast.
To learn from the best of the best, I went to a show called The Gauntlet, which encourages the audience to heckle. At the start of the show, the host gave me a slide whistle. 

Producer and host Chris Connell – yelling his set into a bullhorn – told a joke that intentionally bombed. The audience was nervous, and tense, not wanting to break the normal social rules of comedy. 

“YELL AT ME, YELL AT ME, YELL AT ME!” Chris screamed through the bullhorn.
“It’s important to think about the intent behind the heckler.” 
"""
print(summarizer(ARTICLE2, max_length=300, min_length=30, do_sample=False))