You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy these files from "/vendor/dennis-de-swart/php-stanford-nlp-datastore" to your webserver directory. Usually "htdocs" or "var/www".- datastore.db- bootstrap.php
Example code for your main project:
// instantiate constants and the database require_once __DIR__.'/bootstrap.php'; // startup Corenlp Adapter $coreNLP = new CorenlpAdapter(); $coreNLP->getOutput($yourText); print_r($coreNLP->serverMemory); // result from CoreNLP Adapter // Save result to database $datastore = new Datastore($db->conn); $datastore->storeNLP($coreNLP);
Requirements
PHP 5.6 or higher: it also works on PHP 7
Java SE Runtime Enviroment, version 1.8
Stanford CoreNLP Server 3.7.0
Windows or Linux/Unix 64-bit OS, 8Gb or more memory recommended.
Composer for PHP
https://getcomposer.org/
SQLite Browser
If you need a SQLite browser check here:
http://sqlitebrowser.org/
Important notes
Starting the CoreNLP server for the first time, takes some time because it will load a large amount of data.
After the first startup, the server will be much faster.
In my experience the Stanford CoreNLP server runs best with 8Gb of memory or more. Start the server with "-mx8g" instead of "-mx4g".
Also use version 3.7.0 of the server, this gives you the best and quickest results.
Example output
See
"datastore_result_a.PNG"
"datastore_result_b.PNG"
"datastore_result_search.PNG"
and "example.db", this is how a filled database looks like
Any questions?
Let me know. You can create an issue on GitHub. Any bugs will be fixed ASAP.