زاحف أخبار بسيط للغاية في بيثون. تم تطويره في جامعة هومبولت في برلين.
بداية سريعة | دروس | مصادر الأخبار | ورق
Fundus هو:
زاحف أخبار ثابتة. يتيح لك Fundus زحف المقالات الإخبارية عبر الإنترنت مع عدد قليل من خطوط كود Python! سواء كان ذلك من مواقع الويب الحية أو مجموعة بيانات CC-News.
حزمة بيثون مفتوحة المصدر. تم بناء Fundus على فكرة بناء شيء ما معًا. نرحب بمساهمتك لمساعدة فوندوس على النمو!
للتثبيت من PIP ، ببساطة:
pip install fundus
Fundus يتطلب Python 3.8+.
دعنا نستخدم Fundus to Clash 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 ) ملاحظة : بشكل افتراضي ، يستخدم الزاحف جميع نوى وحدة المعالجة المركزية المتاحة على نظامك. للحصول على الأداء الأمثل ، نوصي بإعداد عدد العمليات يدويًا باستخدام معلمة processes . هناك قاعدة جيدة تتمثل في تخصيص one process per 200 Mbps of bandwidth . هذا يمكن أن يختلف اعتمادا على السرعة الأساسية.
ملاحظة : استغرق الزحف أعلاه حوالي 7 ساعات باستخدام PublisherCollection بأكمله على جهاز مع اتصال 1000 ميغابت في الثانية ، Core I9-13905H ، ذاكرة الوصول العشوائي 64 جيجابايت ، Windows 11 ودون طباعة المقالات. يمكن أن يختلف الوقت المقدر بشكل كبير اعتمادًا على الناشر المستخدم وعرض النطاق الترددي المتاح. بالإضافة إلى ذلك ، لا يتم تضمين جميع الناشرين في CC-NEWS Crawl (وخاصة الناشرين في الولايات المتحدة). لإنشاء مجموعة كبيرة ، يمكن للمرء أيضًا استخدام الزاحف العادي عن طريق استخدام خرائط سيتيمي فقط ، والتي تتطلب عرض نطاق ترددي أقل بكثير.
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 )نحن نقدم برامج تعليمية سريعة لتبدأ في المكتبة:
إذا كنت ترغب في المساهمة ، تحقق من هذه البرامج التعليمية:
يمكنك العثور على الناشرين المدعومون حاليًا هنا .
أيضا: إضافة ناشر جديد أمر سهل - النظر في المساهمة في المشروع!
تحقق من معيار التقييم لدينا.
يلخص الجدول التالي الأداء الكلي لـ Fundus وتقييم الكاشطات من حيث متوسط الدقة Rouge-Lsum ، استدعاء ودرجات F1 وانحرافها المعياري. يتم فرز الجدول بترتيب تنازلي على درجة F1:
| مكشطة | دقة | يتذكر | F1 درجة | إصدار |
|---|---|---|---|---|
| قاع | 99.89 ± 0.57 | 96.75 ± 12.75 | 97.69 ± 9.75 | 0.4.1 |
| Trafilatura | 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 |
| Boilernet | 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 |
يرجى الاستشهاد بالورقة التالية عند استخدام Fundus أو بناء عملنا:
@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
شكرا لاهتمامك بالمساهمة! هناك العديد من الطرق للمشاركة ؛ ابدأ بإرشادات المساهمين لدينا ثم تحقق من هذه المشكلات المفتوحة لمهام محددة.
معهد ماساتشوستس للتكنولوجيا