PyTeaser

所属分类:特征抽取
开发工具:Python
文件大小:65KB
下载次数:0
上传日期:2021-08-28 22:29:17
上 传 者sh-1993
说明:  总结新闻文章
(Summarizes news articles)

文件列表:
LICENSE (1074, 2021-08-29)
demo.py (342, 2021-08-29)
goose (0, 2021-08-29)
goose\LICENSE.txt (10850, 2021-08-29)
goose\__init__.py (2914, 2021-08-29)
goose\article.py (3086, 2021-08-29)
goose\cleaners.py (10161, 2021-08-29)
goose\configuration.py (4131, 2021-08-29)
goose\crawler.py (5459, 2021-08-29)
goose\extractors.py (19185, 2021-08-29)
goose\images (0, 2021-08-29)
goose\images\__init__.py (0, 2021-08-29)
goose\images\extractors.py (15195, 2021-08-29)
goose\images\image.py (2630, 2021-08-29)
goose\images\utils.py (4065, 2021-08-29)
goose\network.py (1564, 2021-08-29)
goose\outputformatters.py (4614, 2021-08-29)
goose\parsers.py (6890, 2021-08-29)
goose\resources (0, 2021-08-29)
goose\resources\images (0, 2021-08-29)
goose\resources\images\known-image-css.txt (232, 2021-08-29)
goose\resources\text (0, 2021-08-29)
goose\resources\text\stopwords-ar.txt (1450, 2021-08-29)
goose\resources\text\stopwords-de.txt (5967, 2021-08-29)
goose\resources\text\stopwords-en.txt (3585, 2021-08-29)
goose\resources\text\stopwords-es.txt (2185, 2021-08-29)
goose\resources\text\stopwords-fr.txt (2002, 2021-08-29)
goose\resources\text\stopwords-it.txt (3005, 2021-08-29)
goose\resources\text\stopwords-ru.txt (5836, 2021-08-29)
goose\resources\text\stopwords-sv.txt (3956, 2021-08-29)
goose\resources\text\stopwords-zh.txt (623, 2021-08-29)
goose\text.py (5070, 2021-08-29)
goose\utils (0, 2021-08-29)
goose\utils\__init__.py (4267, 2021-08-29)
goose\utils\encoding.py (4889, 2021-08-29)
goose\version.py (937, 2021-08-29)
... ...

PyTeaser ======== PyTeaser takes any news article and extract a brief summary from it. It's based on the original [Scala](https://github.com/MojoJolo/textteaser) project. Summaries are created by ranking sentences in a news article according to how relevant they are to the entire text. The top 5 sentences are used to form a "summary". Each sentence is ranked by using four criteria: - Relevance to the title - Relevance to keywords in the article - Position of the sentence - Length of the sentence # Installation: Requires Python 2.7. (Need Collections.Counter) ``` sudo pip install pyteaser ``` These dependency packages will be automatically installed: ``` Pillow lxml cssselect jieba beautifulsoup ``` Note: if you're installing on Windows, you have to install one of the dependency package lxml manually using: ``` easy_install lxml==2.3.3 ``` More information about this issue here: https://github.com/xiaoxu193/PyTeaser/issues/17 # Usage: ## sample command: ```Python >>> from pyteaser import SummarizeUrl >>> url = 'http://www.huffingtonpost.com/2013/11/22/twitter-forward-secrecy_n_4326599.html' >>> summaries = SummarizeUrl(url) >>> print summaries ``` ## output ``` ["Twitter\'s move is the latest response from U.S. Internet firms following disclosures by former spy agency contractor Edward Snowden about widespread, classified U.S. government surveillance programs.", "\\"Since then, it has become clearer and clearer how important that step was to protecting our users\' privacy.\\"", "The online messaging service, which began scrambling communications in 2011 using traditional HTTPS encryption, said on Friday it has added an advanced layer of protection for HTTPS known as \\"forward secrecy.\\"", "\\"A year and a half ago, Twitter was first served completely over HTTPS,\\" the company said in a blog posting.", " \\"I\'m glad this is the direction the industry is taking.\\" \\n\\n(Reporting by Jim Finkle; editing by Andrew Hay)"] ``` you can use Summarize(title, text) directly if you already have the text and the title. Otherwise you must install Python Goose to extract text from url.

近期下载者

相关文件


收藏者