Skip to content

Instantly share code, notes, and snippets.

@wfng92
Created May 4, 2021 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wfng92/d2e4aea5a4d2cce91af083c6ff9783d6 to your computer and use it in GitHub Desktop.
Save wfng92/d2e4aea5a4d2cce91af083c6ff9783d6 to your computer and use it in GitHub Desktop.
import en_textcat_sarcasm
nlp = en_textcat_sarcasm.load()
text = ['yea right, so funny', 'You forgot "Am I a joke to you" guy', "Pretty ballsey for Ted to mouth off to his bosses like that.", "I’m sure she is going to make an absolutely stellar cop, with no power trip agenda whatsoever", "Shut up, college boy!!"]
docs = list(nlp.pipe(text))
result = []
for doc in docs:
print(doc.text)
print(f"{doc.cats}\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment