Skip to content

Instantly share code, notes, and snippets.

@luisfredgs
Last active April 18, 2020 19:57
Show Gist options
  • Save luisfredgs/16c1154f969f9b012123ac1d85a3dd35 to your computer and use it in GitHub Desktop.
Save luisfredgs/16c1154f969f9b012123ac1d85a3dd35 to your computer and use it in GitHub Desktop.
Extractive text summarization spacy
import spacy
from spacy.lang.pt.stop_words import STOP_WORDS
from sklearn.feature_extraction.text import CountVectorizer
import pt_core_news_sm
nlp = pt_core_news_sm.load()
with open("original_text.txt", "r", encoding="utf-8") as f:
text = " ".join(f.readlines())
doc = nlp(text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment