Skip to content

Instantly share code, notes, and snippets.

@UrszulaCzerwinska
Last active April 27, 2021 21:06
Show Gist options
  • Select an option

  • Save UrszulaCzerwinska/cd03ccee2b7d056c65bed7acfbcec1c0 to your computer and use it in GitHub Desktop.

Select an option

Save UrszulaCzerwinska/cd03ccee2b7d056c65bed7acfbcec1c0 to your computer and use it in GitHub Desktop.
#ipmort finction from other gists
from entites_graph import NewsMining
from html_file_parsing import ArticleParsing
#imports
import pandas as pd
# set url
url = "https://towardsdatascience.com/cat-dog-or-elon-musk-145658489730"
# extract text
ap= ArticleParsing(url)
res = ap.main()
# article content to text
content = '. '.join([res.title[0], res.subtitle[0], res.text[0]])
# extract NERs and graph dependences
Miner = NewsMining()
Miner.main(content,mynewmodel, js=True) # creates graph_show.html dans local repo
# export dependency graph
_input =pd.DataFrame(Miner.events)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment