PHP Science TextRank
Arabic & Turkish languages support
이 소스 코드는 MIT 라이센스에 따라 PHP 프로그래밍 언어로 TextRank 알고리즘을 구현한 것입니다.
ChatGPT와 같은 GPT는 컨텍스트를 이해하고 방대한 리소스를 사용하여 주어진 입력에서 새로운 콘텐츠를 생성하는 지도 언어 모델인 반면 TextRank는 비용 효율적이고 저렴한 텍스트 추출 알고리즘입니다. TextRank 알고리즘은 GPT 모델의 전처리기로 사용되어 텍스트 크기를 줄여 리소스 소비를 절약할 수도 있습니다.
자동 요약은 원본 문서의 가장 중요한 내용을 유지한 요약을 작성하기 위해 텍스트 문서를 컴퓨터 프로그램으로 축소하는 프로세스입니다. 일관성 있는 요약을 만들 수 있는 기술은 길이, 쓰기 스타일, 구문과 같은 변수를 고려합니다. 자동 데이터 요약은 기계 학습 및 데이터 마이닝의 일부입니다. 요약의 주요 아이디어는 전체 집합의 정보를 포함하는 데이터의 대표 하위 집합을 찾는 것입니다. 요약 기술은 오늘날 산업계의 수많은 부문에서 사용됩니다. - 위키피디아
이 구현의 알고리즘은 다음과 같습니다.
cd your-project-folder
composer require php-science/textrank
cd git-project-folder
docker-compose build
docker-compose up -d
composer install
composer test
use PhpScience TextRank Tool StopWords English ;
// String contains a long text, see the /res/sample1.txt file.
$ text = " Lorem ipsum... " ;
$ api = new TextRankFacade ();
// English implementation for stopwords/junk words:
$ stopWords = new English ();
$ api -> setStopWords ( $ stopWords );
// Array of the most important keywords:
$ result = $ api -> getOnlyKeyWords ( $ text );
// Array of the sentences from the most important part of the text:
$ result = $ api -> getHighlights ( $ text );
// Array of the most important sentences from the text:
$ result = $ api -> summarizeTextBasic ( $ text );
더 많은 예:
이름 | GitHub 사용자 |
---|---|
데이비드 벨리차 | @DavidBelicza |
리카르도 마튼 | @riccardomarton |
신데시 | @신데시 |
빈센트치 | @vincentsch |
앤드류 웰치 | @칼와트 |
안드레이 아스타쇼프 | @mvcaaa |
레오 토네프 | @bragle |
윌리 아리스키 | @willyarisky |
로버트-얀 카이저 | @KeizerDev |
모티 | @evil1morty |
Sezer Fidancı | @SezerFidanci |