Download the PHP package ali-apadana/persian-keyword without Composer

On this page you can find all versions of the php package ali-apadana/persian-keyword. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package persian-keyword

PersianKeyword

ali-apadana/persian-keyword is a Laravel-first package for extracting keywords, important phrases, and dictionary-based named entities from Persian (Farsi) text.

Version 2.4 provides native phrase-aware ranking, person and organization recognition, and sport-event recognition. It remains fully PHP/Laravel based and requires no external service.

HTML content is supported: tags are removed and entities such as ‌ and   are decoded before extraction.

Known letter-and-number model names remain one token. For example, اف ۳۵ and F-35 are extracted as complete model identifiers rather than separate words.

The built-in stop-word dictionary includes broad Persian coverage: formal connectors, pronoun variants, number and temporal forms, news boilerplate, auxiliary verbs, and frequent non-topical verb forms. Pattern rules also cover inflections such as می‌تواند, نمی‌توانند, and می‌گوید. You can point resources.stopwords at your own PHP list after publishing the configuration if your content needs different rules.

Common past and perfect verb forms such as گرفته‌اند, کرده‌ایم, and رسیدند are filtered with native patterns, so sentence-ending verbs do not become keywords.

Requirements

Installation

Laravel discovers the package automatically. To customize its defaults, publish the configuration file:

Usage

The extractor ranks meaningful phrases alongside single terms. For example, a title containing حمله سایبری به سیستم‌های آبرسانی ۱۲ ایالت آمریکا prioritizes حمله سایبری, آمریکا, and آبرسانی instead of standalone numbers or generic heads such as سیستم.

It also recognizes organization phrases without requiring a dictionary entry. For example, باشگاه استقلال is detected as an organization entity and receives a ranking boost.

Names that immediately precede an official title are detected as people. For example, محمد باقر قالیباف رئیس مجلس detects محمد باقر قالیباف as a person; government organizations such as مجلس شورای اسلامی are also recognized as complete entities.

The same native rule supports cultural and academic roles: علی قائمی is recognized as a person in a phrase such as علی قائمی، اندیشمند مازندرانی.

The native facility rules recognize numbered South Pars refineries such as پالایشگاه سوم پارس جنوبی. The built-in entity dictionary also includes the Industrial Development and Renovation Organization of Iran and its acronym, ایدرو.

Common sport events such as جام ملت‌های آسیا, جام جهانی, لیگ برتر, and بازی‌های المپیک are also recognized as event entities and receive an additional ranking boost.

Sports support also recognizes تیم ملی فوتبال ایران, club-country names such as ویتبسک بلاروس, and disciplinary events such as اخراج.

For general news and health content, native rules recognize events such as تیراندازی در مدرسه and terms such as سرطان مری; long institutions such as دانشگاه علوم پزشکی تهران are also detected.

Pass options for a single extraction when needed:

keywords() returns the ranked keyword strings. Use keywordScores() when you also need each keyword's numeric score and frequency:

Each detected entity records its name, type, and whether it came from the title or body:

The 0.2 result also exposes the normalized source text in $result->meta():

By default, tokens() removes the package stop words. Preserve them for a specific call when you need the raw token stream:

phrases() returns unique two- and three-term candidates, such as آموزش لاراول and برنامه نویسی لاراول. A phrase never spans a stop word.

You can also use the service directly:

Configuration

The initial dictionary is stored in resources/entities.php. After publishing the package configuration, point resources.entities to your own PHP dictionary file when your application needs additional entity types or names.

Development

Notes

Entity detection in 1.0 is dictionary-based. It is fast and deterministic, but it does not infer entities that are absent from the configured dictionary.

License

Released under the MIT License.


All versions of persian-keyword with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^12.0
illuminate/support Version ^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ali-apadana/persian-keyword contains the following files

Loading the files please wait ...