파이썬의 매우 간단한 뉴스 크롤러 . 베를린 훔볼트 대학교에서 개발되었습니다.
빠른 시작 | 튜토리얼 | 뉴스 소스 | 종이
안저는 :
정적 뉴스 크롤러. Fundus는 몇 줄의 파이썬 코드로 온라인 뉴스 기사를 기어 다닐 수 있습니다! 라이브 웹 사이트 또는 CC-News 데이터 세트에서 나옵니다.
오픈 소스 파이썬 패키지. 펀더스는 함께 무언가를 구축한다는 생각에 기반을두고 있습니다. 우리는 펀더스 성장을 돕기 위해 당신의 기여를 환영합니다!
PIP에서 설치하려면 간단히 수행하십시오.
pip install fundus
안저에는 Python 3.8+가 필요합니다.
펀더스를 사용하여 미국에 본사를 둔 출판사의 2 기사를 크롤링합시다.
from fundus import PublisherCollection , Crawler
# initialize the crawler for news publishers based in the US
crawler = Crawler ( PublisherCollection . us )
# crawl 2 articles and print
for article in crawler . crawl ( max_articles = 2 ):
print ( article )그게 이미 그다!
이 코드를 실행하면 다음과 같은 내용을 인쇄해야합니다.
Fundus-Article:
- Title: "Feinstein's Return Not Enough for Confirmation of Controversial New [...]"
- Text: "Democrats jammed three of President Joe Biden's controversial court nominees
through committee votes on Thursday thanks to a last-minute [...]"
- URL: https://freebeacon.com/politics/feinsteins-return-not-enough-for-confirmation-of-controversial-new-hampshire-judicial-nominee/
- From: FreeBeacon (2023-05-11 18:41)
Fundus-Article:
- Title: "Northwestern student government freezes College Republicans funding over [...]"
- Text: "Student government at Northwestern University in Illinois "indefinitely" froze
the funds of the university's chapter of College Republicans [...]"
- URL: https://www.foxnews.com/us/northwestern-student-government-freezes-college-republicans-funding-poster-critical-lgbtq-community
- From: FoxNews (2023-05-09 14:37)이 인쇄물은 두 기사를 성공적으로 기어 다녔다는 것을 알려줍니다!
각 기사에 대해 인쇄물 세부 사항 :
대신 특정 뉴스 소스를 기어 다니고 싶을 수도 있습니다. 워싱턴 타임즈의 뉴스 기사를 크롤링합시다.
from fundus import PublisherCollection , Crawler
# initialize the crawler for The New Yorker
crawler = Crawler ( PublisherCollection . us . TheNewYorker )
# crawl 2 articles and print
for article in crawler . crawl ( max_articles = 2 ):
print ( article ) 이러한 방대한 양의 데이터를 크롤링하기 위해 Fundus는 CommonCrawl 웹 아카이브, 특히 뉴스 크롤링 CC-NEWS 에 의존합니다. CommonCrawl 또는 CC-NEWS 에 익숙하지 않은 경우 웹 사이트를 확인하십시오. CCNewsCrawler 를 가져 오기 만하면 미리 튜토리얼을 확인하십시오.
from fundus import PublisherCollection , CCNewsCrawler
# initialize the crawler using all publishers supported by fundus
crawler = CCNewsCrawler ( * PublisherCollection )
# crawl 1 million articles and print
for article in crawler . crawl ( max_articles = 1000000 ):
print ( article ) 참고 : 기본적으로 Crawler는 시스템에서 사용 가능한 모든 CPU 코어를 사용합니다. 최적의 성능을 위해 processes 매개 변수를 사용하여 프로세스 수를 수동으로 설정하는 것이 좋습니다. 경험의 좋은 규칙은 one process per 200 Mbps of bandwidth 할당하는 것입니다. 코어 속도에 따라 다를 수 있습니다.
참고 : 위의 크롤링은 1000Mbps 연결, 코어 i9-13905H, 64GB RAM, Windows 11 및 기사를 인쇄하지 않은 기계의 전체 PublisherCollection 사용하여 ~ 7 시간이 걸렸습니다. 예상 시간은 사용 된 게시자와 사용 가능한 대역폭에 따라 크게 다를 수 있습니다. 또한 모든 게시자가 CC-NEWS 크롤링 (특히 미국 기반 출판사)에 포함되는 것은 아닙니다. 대형 코퍼스 제작의 경우 Sitemap 만 사용하여 일반 크롤러를 사용할 수 있으며 대역폭이 훨씬 적습니다.
from fundus import PublisherCollection , Crawler , Sitemap
# initialize a crawler for us/uk based publishers and restrict to Sitemaps only
crawler = Crawler ( PublisherCollection . us , PublisherCollection . uk , restrict_sources_to = [ Sitemap ])
# crawl 1 million articles and print
for article in crawler . crawl ( max_articles = 1000000 ):
print ( article )도서관을 시작할 수있는 빠른 자습서를 제공합니다.
기여하려면 다음 자습서를 확인하십시오.
현재 지원되는 게시자를 찾을 수 있습니다 .
또한 : 새로운 게시자를 추가하는 것은 쉽습니다. 프로젝트에 기여하는 것을 고려하십시오!
평가 벤치 마크를 확인하십시오.
다음 표는 평균 Rouge-Lsum Precision, Recall 및 F1-Score 및 표준 편차 측면에서 펀더스 및 평가 스크레이퍼의 전체 성능을 요약합니다. 테이블은 F1- 점수를 통해 내림차순으로 정렬됩니다.
| 스크레이퍼 | 정도 | 상기하다 | F1- 점수 | 버전 |
|---|---|---|---|---|
| 안저 | 99.89 ± 0.57 | 96.75 ± 12.75 | 97.69 ± 9.75 | 0.4.1 |
| 트라필라 더라 | 93.91 ± 12.89 | 96.85 ± 15.69 | 93.62 ± 16.73 | 1.12.0 |
| 뉴스가 나옵니다 | 97.95 ± 10.08 | 91.89 ± 16.15 | 93.39 ± 14.52 | 1.6.13 |
| BTE | 81.09 ± 19.41 | 98.23 ± 8.61 | 87.14 ± 15.48 | / |
| Justext | 86.51 ± 18.92 | 90.23 ± 20.61 | 86.96 ± 19.76 | 3.0.1 |
| 보일러 넷 | 85.96 ± 18.55 | 91.21 ± 19.15 | 86.52 ± 18.03 | / |
| 보일러 파이프 | 82.89 ± 20.65 | 82.11 ± 29.99 | 79.90 ± 25.86 | 1.3.0 |
안저를 사용하거나 우리의 작업을 구축 할 때 다음 논문을 인용하십시오.
@inproceedings { dallabetta-etal-2024-fundus ,
title = " Fundus: A Simple-to-Use News Scraper Optimized for High Quality Extractions " ,
author = " Dallabetta, Max and
Dobberstein, Conrad and
Breiding, Adrian and
Akbik, Alan " ,
editor = " Cao, Yixin and
Feng, Yang and
Xiong, Deyi " ,
booktitle = " Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations) " ,
month = aug,
year = " 2024 " ,
address = " Bangkok, Thailand " ,
publisher = " Association for Computational Linguistics " ,
url = " https://aclanthology.org/2024.acl-demos.29 " ,
pages = " 305--314 " ,
}Max Dallabetta 에게 질문이나 의견을 이메일로 보내주십시오
기여에 관심을 가져 주셔서 감사합니다! 참여하는 방법에는 여러 가지가 있습니다. 기고자 가이드 라인으로 시작한 다음 특정 작업에 대한 이러한 열린 문제를 확인하십시오.
MIT