Download the PHP package web64/laravel-nlp without Composer
On this page you can find all versions of the php package web64/laravel-nlp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download web64/laravel-nlp
More information about web64/laravel-nlp
Files in web64/laravel-nlp
Package laravel-nlp
Short Description Laravel package for accessing NLP tools
License MIT
Informations about the package laravel-nlp
Laravel NLP
A simple wrapper for the PHP-NLP-Client library for accessing Python and Java NLP libraries and external NLP APIs.
Installation
Plese follow the instructions here to install the NLP Server and CoreNLP server:
If you want to use Opencalais, get a token by registering here and read their terms of service
Configuration
Add NLPSERVER_URL
to your .env
file to specify the location of where the NLP Server is running.
If you want to use CoreNLP or Opencalais also fill inn those details in .env.
Alternatively, update the nlp.php configuration file.
Quick Start
NLP Server
This package requires a running instance of the NLP Server (https://github.com/web64/nlpserver) for most of the functionality to work. See the documentation for installation instructions of the NLP Server.
Included NLP Tools
- Language Detection
- Article Extraction
- Entity Extraction (Named Entity Recognition)
- Sentiment Analysis
- Summarization
- Translation
- Neighbouring Words
- Concepts
Usage
Include the class to use the NLP facade.
Language Detection
Article Extraction
Entity Extraction with Polyglot
This function uses the Polyglot library which supports entity extraction for 40 languages. Make sure you have downloaded the language models for the languages you are using.
For English and other major European languages use Spacy or CoreNLP for best results.
Entity Extraction with Spacy
A running NLP Server provides access to Spacy's entity extraction.
Spacy has language models for English, German, Spanish, Portuguese, French, Italian and Dutch.
Entitiy extraction with CoreNLP
CoreNLP provides very good entoty extraction for English texts.
To use this function you need a running instance of the CoreNLP server. See installation inststructions
Specify the URL of the CoreNLP server in CORENLP_HOST
in .env or config/nlp/php
.
Sentiment Analysis
This will return a value ranging from -1 to +1, where > 0 is considered to have a positive sentiment and everython < 0 has a negative sentiment.
Provide the language code as the second parameter to specify the language of the text. (default='en').
Summarization
This will take a long text and return a summary of what is considered to be the most important sentences. An optional max. number of words can be speficied.
Translation
Second parameter is the source language. Language will be automatically detected if left as NULL
Neighbouring Words
This uses word embeddings to find related words from the one given.
Concepts
This uses Microsoft Concept Graph For Short Text Understanding: https://concept.research.microsoft.com/
An array of related concepts will be returned.
More
For other Laravel NLP packages, check out:
- https://github.com/AntoineAugusti/laravel-sentiment-analysis
- https://github.com/michaeljhopkins/Laravel-Aylien-Wrapper
- https://github.com/findbrok/laravel-personality-insights
Contribute
Get in touch if you have any feedback or ideas on how to improve this package or the documentation.
All versions of laravel-nlp with dependencies
lsmonki/php-open-calais Version ^2.1
stichoza/google-translate-php Version ~4.1