File size: 585 Bytes
dd7488f
 
1b47089
 
dd7488f
8de7c36
dd7488f
 
 
 
 
 
 
8de7c36
1b47089
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import core.pipelines as pipelines_functions
from inspect import getmembers, isfunction
from newspaper import Article
import streamlit as st


def get_pipelines():
    pipeline_names, pipeline_funcs = list(
        zip(*getmembers(pipelines_functions, isfunction))
    )
    pipeline_names = [
        " ".join([n.capitalize() for n in name.split("_")]) for name in pipeline_names
    ]
    return pipeline_names, pipeline_funcs


@st.experimental_memo
def extract_text_from_url(url: str):
    article = Article(url)
    article.download()
    article.parse()

    return article.text