Pytextrank เป็นการดำเนินการ Python ของ Textrank เป็นส่วนขยายไปป์ไลน์ของ Spacy สำหรับงานภาษาธรรมชาติที่ใช้กราฟ-และการปฏิบัติกราฟความรู้ที่เกี่ยวข้อง ซึ่งรวมถึงตระกูลอัลกอริทึม TextGraph :
กรณีการใช้งานยอดนิยมสำหรับห้องสมุดนี้รวมถึง:
ดูเอกสารฉบับเต็มของเราได้ที่: https://derwen.ai/docs/ptr/
ดูส่วน "การเริ่มต้น" ของเอกสารออนไลน์
เพื่อติดตั้งจาก PYPI:
python3 -m pip install pytextrank
python3 -m spacy download en_core_web_sm
หากคุณทำงานโดยตรงจาก repo git นี้อย่าลืมติดตั้งการพึ่งพาเช่นกัน:
python3 -m pip install -r requirements.txt
อีกวิธีหนึ่งคือการติดตั้งการพึ่งพาโดยใช้ conda :
conda env create -f environment.yml
conda activate pytextrank
จากนั้นใช้ไลบรารีด้วยเคสใช้งานง่าย ๆ :
import spacy
import pytextrank
# example text
text = "Compatibility of systems of linear constraints over the set of natural numbers. Criteria of compatibility of a system of linear Diophantine equations, strict inequations, and nonstrict inequations are considered. Upper bounds for components of a minimal set of solutions and algorithms of construction of minimal generating sets of solutions for all types of systems are given. These criteria and the corresponding algorithms for constructing a minimal supporting set of solutions can be used in solving all the considered types systems and systems of mixed types."
# load a spaCy model, depending on language, scale, etc.
nlp = spacy . load ( "en_core_web_sm" )
# add PyTextRank to the spaCy pipeline
nlp . add_pipe ( "textrank" )
doc = nlp ( text )
# examine the top-ranked phrases in the document
for phrase in doc . _ . phrases :
print ( phrase . text )
print ( phrase . rank , phrase . count )
print ( phrase . chunks ) ดู สมุดบันทึกการสอน ใน examples ไดเรกทอรีตัวอย่างสำหรับโค้ดตัวอย่างและรูปแบบที่จะใช้ในการรวม pytexttank เข้ากับไลบรารีที่เกี่ยวข้องใน Python: https://derwen.ai/docs/ptr/tutorial/
เรายินดีต้อนรับผู้คนที่มีส่วนร่วมในฐานะผู้มีส่วนร่วมในโครงการโอเพนซอร์สนี้!
สำหรับคำแนะนำโดยละเอียดโปรดดู: Inteding.md
เพียงแค่ติดตั้งจาก PYPI หรือใช้ Conda
หากต้องการตั้งค่าสภาพแวดล้อมการสร้างในพื้นที่ให้ดูที่ส่วน "คำแนะนำในการสร้าง" ของเอกสารออนไลน์
โดยทั่วไปแล้วการพูดถึงหมายเลขรีลีสที่สำคัญของ Pytextrank จะติดตามด้วยหมายเลขรุ่นที่สำคัญของเวอร์ชัน spaCy ที่เกี่ยวข้อง
ดู: changelog.md
ซอร์สโค้ดสำหรับ pytextrank บวกโลโก้เอกสารและตัวอย่างมีใบอนุญาต MIT ซึ่งมีความกระชับและทำให้การใช้งานในแอปพลิเคชันเชิงพาณิชย์ง่ายขึ้น
วัสดุทั้งหมดในที่นี้มีลิขสิทธิ์© 2016-2024 Derwen, Inc.
โปรดใช้รายการ bibtex ต่อไปนี้สำหรับการอ้างถึง pytextrank หากคุณใช้ในการวิจัยหรือซอฟต์แวร์ของคุณ:
@software { PyTextRank ,
author = { Paco Nathan } ,
title = { {PyTextRank, a Python implementation of TextRank for phrase extraction and summarization of text documents} } ,
year = 2016 ,
publisher = { Derwen } ,
doi = { 10.5281/zenodo.4637885 } ,
url = { https://github.com/DerwenAI/pytextrank }
}การอ้างอิงมีประโยชน์สำหรับการพัฒนาอย่างต่อเนื่องและการบำรุงรักษาห้องสมุดนี้ ตัวอย่างเช่นดูการอ้างอิงของเราใน Google Scholar
ขอบคุณมากสำหรับผู้สนับสนุนโอเพ่นซอร์สของเรา และสำหรับผู้มีส่วนร่วมของเรา: @ceteri, @louisguitton, @ankush-chander, @tomaarsen, @captxiong, @lord-v15, @anna-droid-beep, @dvsrepo, @clabornd, @dayalstrub-cma, @kavorite @harshgrandeur, @mnowotka, @kjam, @saithejeshwar, @laxatives, @dimmu, @jasonzhangzy1757, @jake-aft, @junchen1992, @shyamcody, @chikubee; นอกจากนี้ถึง @mihalcea ที่เป็นผู้นำงานวิจัย NLP ที่โดดเด่นให้กำลังใจจากคนที่ยอดเยี่ยมในการระเบิดที่พัฒนา Spacy รวมถึงการสนับสนุนทั่วไปจาก Derwen, Inc.