Skip to content

Commit 67d4df9

Browse files
Dennis de SwartDennis de Swart
Dennis de Swart
authored and
Dennis de Swart
committed
Increased execution time, improved error messages, updated README
1 parent 298bcc4 commit 67d4df9

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
PHP adapter for use with Stanford CoreNLP
55

66

7+
78
## Features
89
- Connect to Stanford University CoreNLP API online
910
- Connect to Stanford CoreNLP 3.7.0 server
1011
- Annotators available: tokenize,ssplit,pos, parse, depparse, ner, regexner,lemma, mention, natlog, coref, openie, kbp
1112
- The package creates Part-Of-Speech Trees with depth, parent- and child ID
1213

1314

15+
1416
## Requirements
1517
- PHP 5.5 or higher: it also works on PHP 7
1618
- Windows or Linux 64-bit, 8Gb memory or more recommended
@@ -21,6 +23,7 @@ PHP adapter for use with Stanford CoreNLP
2123
```
2224

2325

26+
2427
## Installation using ZIP files
2528

2629
- Install Stanford CoreNLP Server. See the installation walkthrough below.
@@ -29,6 +32,7 @@ PHP adapter for use with Stanford CoreNLP
2932
- Run a Composer update
3033

3134

35+
3236
## Installation using Composer
3337

3438
- Insert the following line into the "require" of your "composer.json" file.
@@ -44,6 +48,7 @@ PHP adapter for use with Stanford CoreNLP
4448
- Run a composer update
4549

4650

51+
4752
## Using the Stanford CoreNLP online API service
4853

4954

@@ -52,6 +57,7 @@ Note that the online API is a public service. If you want to analyze large volum
5257
please install the Java server version.
5358

5459

60+
5561
## OpenIE
5662

5763
OpenIE creates "subject-relation-object" tuples. This is similar (but not the same) as the "Subject-Verb-Object" concept of the English language.
@@ -66,6 +72,7 @@ https://en.wikipedia.org/wiki/Subject-verb-object
6672
```
6773

6874

75+
6976
# Installation / Walkthrough for Java server version
7077

7178

bootstrap.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
error_reporting(E_ALL);
77
ini_set('display_errors', 1);
8+
ini_set('max_execution_time', 300); // 300 seconds, because some analysis can take up to 1 or 2 minutes.
89

910
/**
1011
* Use the online API?
@@ -41,4 +42,11 @@
4142
/**
4243
* Start composer autoloader
4344
*/
44-
require __DIR__.'/vendor/autoload.php';
45+
46+
if(!@include_once(__DIR__.'/vendor/autoload.php')) {
47+
echo '<br />CoreNLP Adapter error: could not load "Composer" files. <br /><br />'
48+
. '- Run "composer update" on the command line<br />'
49+
. '- If Composer is not installed, go to: <a href="https://getcomposer.org/">install Composer</a></p>';
50+
die;
51+
}
52+

index.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
<?php
22

33
/**
4-
* Important notes (1):
4+
* Important notes:
55
* - To use the online API : set ONLINE_API to TRUE
66
* - To use Java CoreNLP : set ONLINE_API to FALSE
77
*
8-
* Important notes (2):
9-
* - ONLINE_API is set to TRUE by default. You can change this setting in "bootstrap.php"
10-
* - The online API is a public service by Stanford University. Please use with care.
11-
* - For intensive use or sensitive data, please use the Java version of CoreNLP: http://stanfordnlp.github.io/CoreNLP/download.html
8+
* - ONLINE_API is set to FALSE by default. You can change this setting in "bootstrap.php"
129
* - OpenIE annotator is only available on the Java version
1310
*/
11+
1412
require_once __DIR__.'/bootstrap.php'; // bootstrap also contains the config
1513

1614
/**

0 commit comments

Comments
 (0)