PHPackages                             dennis-de-swart/php-stanford-corenlp-adapter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. dennis-de-swart/php-stanford-corenlp-adapter

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

dennis-de-swart/php-stanford-corenlp-adapter
============================================

PHP adapter for use with Stanford CoreNLP tools

7.1.0(7y ago)262.9k↓100%5[2 issues](https://github.com/DennisDeSwart/php-stanford-corenlp-adapter/issues)MITPHPPHP &gt;=5.5

Since Dec 16Pushed 6y ago1 watchersCompare

[ Source](https://github.com/DennisDeSwart/php-stanford-corenlp-adapter)[ Packagist](https://packagist.org/packages/dennis-de-swart/php-stanford-corenlp-adapter)[ Docs](https://github.com/DennisDeSwart/PHP-stanford-corenlp-adapter)[ RSS](/packages/dennis-de-swart-php-stanford-corenlp-adapter/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

PHP Stanford CoreNLP adapter
============================

[](#php-stanford-corenlp-adapter)

[![Version](https://camo.githubusercontent.com/328a94f6ab28af5dc2eda61c72004a9af2882fa4546e22ebc24fc709ec9d13ae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64656e6e69732d64652d73776172742f7068702d7374616e666f72642d636f72656e6c702d616461707465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dennis-de-swart/php-stanford-corenlp-adapter)[![Total Downloads](https://camo.githubusercontent.com/3cf4ffdd46963c29de8f3f01406d3c8ad9c09c99f5264fdc2ed4f08e1e218968/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64656e6e69732d64652d73776172742f7068702d7374616e666f72642d636f72656e6c702d616461707465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dennis-de-swart/php-stanford-corenlp-adapter)[![Maintenance](https://camo.githubusercontent.com/103880b37e0f73f7e9171ab789edfde215270e80ef6e227871e0d210e2dd3127/68747470733a2f2f696d672e736869656c64732e696f2f6d61696e74656e616e63652f7965732f323032302e7376673f7374796c653d666c61742d737175617265)](https://github.com/DennisDeSwart/php-stanford-corenlp-adapter)[![Minimum PHP Version](https://camo.githubusercontent.com/5a7c0787478081952cc7cf21092df637a2ca9e4d9a34dc81fac6422510a1e31a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e362d3441433531432e7376673f7374796c653d666c61742d737175617265)](http://php.net/)[![License](https://camo.githubusercontent.com/8dbf632366025e618694ea64eab4101be8028cc228d6f96f6a379fe8eeed8299/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f64656e6e69732d64652d73776172742f7068702d7374616e666f72642d636f72656e6c702d616461707465722e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)

PHP adapter for use with Stanford CoreNLP

Features
--------

[](#features)

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

Requirements
------------

[](#requirements)

- PHP 5.5 or higher: it also works on PHP 7
- Windows or Linux 64-bit, 8Gb memory or more recommended
- Either Guzzle HTTP Client (installed by default) or only cURL.
- Composer for PHP

```
    https://getcomposer.org/

```

Update 24th February 2018
-------------------------

[](#update-24th-february-2018)

PHP7 Type hinting removed, because it was causing issues for some users.

Update 28th January 2019
------------------------

[](#update-28th-january-2019)

Fixed issue with PHP 7.1 upwards

Installation using ZIP files
----------------------------

[](#installation-using-zip-files)

- Install Stanford CoreNLP Server. See the installation walkthrough below.
- Download and unpack the files from this package.
- Copy the files to your to your webserver directory. Usually "htdocs" or "var/www".
- Run a Composer update

Installation using Composer
---------------------------

[](#installation-using-composer)

- Insert the following line into the "require" of your "composer.json" file.

```
    {
        "require": {
            "dennis-de-swart/php-stanford-corenlp-adapter": "*"
        }
    }

```

- Run a composer update

Using the Stanford CoreNLP online API service
---------------------------------------------

[](#using-the-stanford-corenlp-online-api-service)

The adapter by default uses Stanford's online API service. This should work right after the composer update. Note that the online API is a public service. If you want to analyze large volumes of text or sensitive data, please install the Java server version.

OpenIE
------

[](#openie)

OpenIE creates "subject-relation-object" tuples. This is similar (but not the same) as the "Subject-Verb-Object" concept of the English language.

Notes:

- OpenIE is only available on the Java offline version, not with the "online" mode. See the installation walkthrough below
- OpenIE data is not always available. Sometimes the result array might show empty, this is not an error.

```
http://nlp.stanford.edu/software/openie.html
https://en.wikipedia.org/wiki/Subject-verb-object

```

Installation / Walkthrough for Java server version
==================================================

[](#installation--walkthrough-for-java-server-version)

Step 1: install Java
--------------------

[](#step-1-install-java)

```
https://java.com/en/download/help/index_installing.xml?os=All+Platforms&j=8&n=20

```

Step 2: installing the Stanford CoreNLP 3.7.0 server
----------------------------------------------------

[](#step-2-installing-the-stanford-corenlp-370-server)

```
http://stanfordnlp.github.io/CoreNLP/index.html#download

```

Step 3: Port for server
-----------------------

[](#step-3-port-for-server)

Default port for the Java server is port 9000. If port 9000 is not available you can change the port in the "bootstrap.php" file. Example:

```
define('CURLURL' , 'http://localhost:9000/');

```

Step 4: Start the CoreNLP serve from the command line.
------------------------------------------------------

[](#step-4-start-the-corenlp-serve-from-the-command-line)

Go to the download directory, then enter the following command:

```
java -mx8g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000

```

Important note: the Stanford manual says "-mx4g", however I found that this can lead to a Java OutOfMemory error. It is also important to use a 64-bit operating system with at enough memory (8Gb or more recommended)

Step 5: Test if the server has started by surfing to it's URL
-------------------------------------------------------------

[](#step-5-test-if-the-server-has-started-by-surfing-to-its-url)

```
http://localhost:9000/

```

When you surf to this URL, you should see the CoreNLP GUI. If you have problems with installation you can check the manual:

```
http://stanfordnlp.github.io/CoreNLP/corenlp-server.html

```

Step 6: Set ONLINE\_API to FALSE
--------------------------------

[](#step-6-set-online_api-to-false)

In "bootstrap.php" set define('ONLINE\_API' , FALSE). This tells the Adapter to use the Java version

Usage examples
==============

[](#usage-examples)

Instantiate the adapter:
------------------------

[](#instantiate-the-adapter)

```
$coreNLP = new CorenlpAdapter();

```

To process a text, call the "getOutput" method:
-----------------------------------------------

[](#to-process-a-text-call-the-getoutput-method)

```
 $text = 'The Golden Gate Bridge was designed by Joseph Strauss.';
 $coreNLP->getOutput($text);

```

Note that the first time that you process a text, the server takes about 20 to 30 seconds extra to load definitions. All other calls to the server after that will be much faster. Small texts are usually processed within seconds.

The results
-----------

[](#the-results)

If successful the following properties will be available:

```
 $coreNLP->serverMemory;      //contains all of the server output
 $coreNLP->trees;             //contains processed flat trees. Each part of the tree is assigned an ID key

 $coreNLP->getWordValues($coreNLP->trees[1])  // get just the words from a tree

```

---

### Diagram A: Tree With Tokens

[](#diagram-a-tree-with-tokens)

---

```
Array
(
   [1] => Array
       (
           [parent] =>
           [pennTreebankTag] => ROOT
           [depth] => 0
       )

   [2] => Array
       (
           [parent] => 1
           [pennTreebankTag] => S
           [depth] => 2
       )

   [3] => Array
       (
           [parent] => 2
           [pennTreebankTag] => NP
           [depth] => 4
       )

   [4] => Array
       (
           [parent] => 3
           [pennTreebankTag] => PRP
           [depth] => 6
           [word] => I
           [index] => 1
           [originalText] => I
           [lemma] => I
           [characterOffsetBegin] => 0
           [characterOffsetEnd] => 1
           [pos] => PRP
           [ner] => O
           [before] =>
           [after] =>
           [openIE] => Array
               (
                   [0] => subject
                   [1] => subject
                   [2] => subject
               )

       )

   [5] => Array
       (
           [parent] => 2
           [pennTreebankTag] => VP
           [depth] => 4
       )

   [6] => Array
       (
           [parent] => 5
           [pennTreebankTag] => MD
           [depth] => 6
           [word] => will
           [index] => 2
           [originalText] => will
           [lemma] => will
           [characterOffsetBegin] => 2
           [characterOffsetEnd] => 6
           [pos] => MD
           [ner] => O
           [before] =>
           [after] =>
           [openIE] => Array
               (
                   [0] => subject
                   [1] => subject
                   [2] => relation
               )

       )

   [7] => Array
       (
           [parent] => 5
           [pennTreebankTag] => VP
           [depth] => 6
       )

   [8] => Array
       (
           [parent] => 7
           [pennTreebankTag] => VB
           [depth] => 8
           [word] => meet
           [index] => 3
           [originalText] => meet
           [lemma] => meet
           [characterOffsetBegin] => 7
           [characterOffsetEnd] => 11
           [pos] => VB
           [ner] => O
           [before] =>
           [after] =>
           [openIE] => Array
               (
                   [0] => subject
                   [1] => subject
                   [2] => relation
               )

       )

   [9] => Array
       (
           [parent] => 7
           [pennTreebankTag] => NP
           [depth] => 8
       )

   [10] => Array
       (
           [parent] => 9
           [pennTreebankTag] => NP
           [depth] => 10
       )

   [11] => Array
       (
           [parent] => 10
           [pennTreebankTag] => NNP
           [depth] => 12
           [word] => Mary
           [index] => 4
           [originalText] => Mary
           [lemma] => Mary
           [characterOffsetBegin] => 12
           [characterOffsetEnd] => 16
           [pos] => NNP
           [ner] => PERSON
           [before] =>
           [after] =>
           [openIE] => Array
               (
                   [1] => subject
                   [2] => object
                   [3] => subject
                   [0] => subject
               )

       )

   [12] => Array
       (
           [parent] => 9
           [pennTreebankTag] => PP
           [depth] => 10
       )

   [13] => Array
       (
           [parent] => 12
           [pennTreebankTag] => IN
           [depth] => 12
           [word] => in
           [index] => 5
           [originalText] => in
           [lemma] => in
           [characterOffsetBegin] => 17
           [characterOffsetEnd] => 19
           [pos] => IN
           [ner] => O
           [before] =>
           [after] =>
           [openIE] => Array
               (
                   [1] => relation
                   [3] => relation
                   [0] => relation
               )

       )

   [14] => Array
       (
           [parent] => 12
           [pennTreebankTag] => NP
           [depth] => 12
       )

   [15] => Array
       (
           [parent] => 14
           [pennTreebankTag] => NNP
           [depth] => 14
           [word] => New
           [index] => 6
           [originalText] => New
           [lemma] => New
           [characterOffsetBegin] => 20
           [characterOffsetEnd] => 23
           [pos] => NNP
           [ner] => LOCATION
           [before] =>
           [after] =>
           [openIE] => Array
               (
                   [1] => relation
                   [3] => object
                   [0] => object
               )

       )

   [16] => Array
       (
           [parent] => 14
           [pennTreebankTag] => NNP
           [depth] => 14
           [word] => York
           [index] => 7
           [originalText] => York
           [lemma] => York
           [characterOffsetBegin] => 24
           [characterOffsetEnd] => 28
           [pos] => NNP
           [ner] => LOCATION
           [before] =>
           [after] =>
           [openIE] => Array
               (
                   [1] => object
                   [3] => object
               )

       )

   [17] => Array
       (
           [parent] => 7
           [pennTreebankTag] => PP
           [depth] => 8
       )

   [18] => Array
       (
           [parent] => 17
           [pennTreebankTag] => IN
           [depth] => 10
           [word] => at
           [index] => 8
           [originalText] => at
           [lemma] => at
           [characterOffsetBegin] => 29
           [characterOffsetEnd] => 31
           [pos] => IN
           [ner] => O
           [before] =>
           [after] =>
           [openIE] => Array
               (
                   [1] => object
               )

       )

   [19] => Array
       (
           [parent] => 17
           [pennTreebankTag] => NP
           [depth] => 10
       )

   [20] => Array
       (
           [parent] => 19
           [pennTreebankTag] => CD
           [depth] => 12
           [word] => 10pm
           [index] => 9
           [originalText] => 10pm
           [lemma] => 10pm
           [characterOffsetBegin] => 32
           [characterOffsetEnd] => 36
           [pos] => CD
           [ner] => TIME
           [normalizedNER] => T22:00
           [before] =>
           [after] =>
           [timex] => Array
               (
                   [tid] => t1
                   [type] => TIME
                   [value] => T22:00
               )

           [openIE] => Array
               (
                   [0] => object
                   [1] => object
               )

       )

)

```

---

### Diagram B: The ServerMemory contains all the server data

[](#diagram-b-the-servermemory-contains-all-the-server-data)

---

```
Array
(
    [0] => Array
        (
            [sentences] => Array
                (
                    [0] => Array
                        (
                            [index] => 0
                            [parse] => (ROOT
  (S
    (NP (PRP I))
    (VP (MD will)
      (VP (VB meet)
        (NP
          (NP (NNP Mary))
          (PP (IN in)
            (NP (NNP New) (NNP York))))
        (PP (IN at)
          (NP (CD 10pm)))))))
                            [basic-dependencies] => Array
                                (
                                    [0] => Array
                                        (
                                            [dep] => ROOT
                                            [governor] => 0
                                            [governorGloss] => ROOT
                                            [dependent] => 3
                                            [dependentGloss] => meet
                                        )

                                    [1] => Array
                                        (
                                            [dep] => nsubj
                                            [governor] => 3
                                            [governorGloss] => meet
                                            [dependent] => 1
                                            [dependentGloss] => I
                                        )

                                    [2] => Array
                                        (
                                            [dep] => aux
                                            [governor] => 3
                                            [governorGloss] => meet
                                            [dependent] => 2
                                            [dependentGloss] => will
                                        )

                                    [3] => Array
                                        (
                                            [dep] => dobj
                                            [governor] => 3
                                            [governorGloss] => meet
                                            [dependent] => 4
                                            [dependentGloss] => Mary
                                        )

                                    [4] => Array
                                        (
                                            [dep] => case
                                            [governor] => 7
                                            [governorGloss] => York
                                            [dependent] => 5
                                            [dependentGloss] => in
                                        )

                                    [5] => Array
                                        (
                                            [dep] => compound
                                            [governor] => 7
                                            [governorGloss] => York
                                            [dependent] => 6
                                            [dependentGloss] => New
                                        )

                                    [6] => Array
                                        (
                                            [dep] => nmod
                                            [governor] => 4
                                            [governorGloss] => Mary
                                            [dependent] => 7
                                            [dependentGloss] => York
                                        )

                                    [7] => Array
                                        (
                                            [dep] => case
                                            [governor] => 9
                                            [governorGloss] => 10pm
                                            [dependent] => 8
                                            [dependentGloss] => at
                                        )

                                    [8] => Array
                                        (
                                            [dep] => nmod
                                            [governor] => 3
                                            [governorGloss] => meet
                                            [dependent] => 9
                                            [dependentGloss] => 10pm
                                        )

                                )

                            [collapsed-dependencies] => Array
                                (
                                    [0] => Array
                                        (
                                            [dep] => ROOT
                                            [governor] => 0
                                            [governorGloss] => ROOT
                                            [dependent] => 3
                                            [dependentGloss] => meet
                                        )

                                    [1] => Array
                                        (
                                            [dep] => nsubj
                                            [governor] => 3
                                            [governorGloss] => meet
                                            [dependent] => 1
                                            [dependentGloss] => I
                                        )

                                    [2] => Array
                                        (
                                            [dep] => aux
                                            [governor] => 3
                                            [governorGloss] => meet
                                            [dependent] => 2
                                            [dependentGloss] => will
                                        )

                                    [3] => Array
                                        (
                                            [dep] => dobj
                                            [governor] => 3
                                            [governorGloss] => meet
                                            [dependent] => 4
                                            [dependentGloss] => Mary
                                        )

                                    [4] => Array
                                        (
                                            [dep] => case
                                            [governor] => 7
                                            [governorGloss] => York
                                            [dependent] => 5
                                            [dependentGloss] => in
                                        )

                                    [5] => Array
                                        (
                                            [dep] => compound
                                            [governor] => 7
                                            [governorGloss] => York
                                            [dependent] => 6
                                            [dependentGloss] => New
                                        )

                                    [6] => Array
                                        (
                                            [dep] => nmod:in
                                            [governor] => 4
                                            [governorGloss] => Mary
                                            [dependent] => 7
                                            [dependentGloss] => York
                                        )

                                    [7] => Array
                                        (
                                            [dep] => case
                                            [governor] => 9
                                            [governorGloss] => 10pm
                                            [dependent] => 8
                                            [dependentGloss] => at
                                        )

                                    [8] => Array
                                        (
                                            [dep] => nmod:at
                                            [governor] => 3
                                            [governorGloss] => meet
                                            [dependent] => 9
                                            [dependentGloss] => 10pm
                                        )

                                )

                            [collapsed-ccprocessed-dependencies] => Array
                                (
                                    [0] => Array
                                        (
                                            [dep] => ROOT
                                            [governor] => 0
                                            [governorGloss] => ROOT
                                            [dependent] => 3
                                            [dependentGloss] => meet
                                        )

                                    [1] => Array
                                        (
                                            [dep] => nsubj
                                            [governor] => 3
                                            [governorGloss] => meet
                                            [dependent] => 1
                                            [dependentGloss] => I
                                        )

                                    [2] => Array
                                        (
                                            [dep] => aux
                                            [governor] => 3
                                            [governorGloss] => meet
                                            [dependent] => 2
                                            [dependentGloss] => will
                                        )

                                    [3] => Array
                                        (
                                            [dep] => dobj
                                            [governor] => 3
                                            [governorGloss] => meet
                                            [dependent] => 4
                                            [dependentGloss] => Mary
                                        )

                                    [4] => Array
                                        (
                                            [dep] => case
                                            [governor] => 7
                                            [governorGloss] => York
                                            [dependent] => 5
                                            [dependentGloss] => in
                                        )

                                    [5] => Array
                                        (
                                            [dep] => compound
                                            [governor] => 7
                                            [governorGloss] => York
                                            [dependent] => 6
                                            [dependentGloss] => New
                                        )

                                    [6] => Array
                                        (
                                            [dep] => nmod:in
                                            [governor] => 4
                                            [governorGloss] => Mary
                                            [dependent] => 7
                                            [dependentGloss] => York
                                        )

                                    [7] => Array
                                        (
                                            [dep] => case
                                            [governor] => 9
                                            [governorGloss] => 10pm
                                            [dependent] => 8
                                            [dependentGloss] => at
                                        )

                                    [8] => Array
                                        (
                                            [dep] => nmod:at
                                            [governor] => 3
                                            [governorGloss] => meet
                                            [dependent] => 9
                                            [dependentGloss] => 10pm
                                        )

                                )

                            [openie] => Array
                                (
                                    [0] => Array
                                        (
                                            [subject] => I
                                            [subjectSpan] => Array
                                                (
                                                    [0] => 0
                                                    [1] => 1
                                                )

                                            [relation] => will meet Mary at
                                            [relationSpan] => Array
                                                (
                                                    [0] => 1
                                                    [1] => 3
                                                )

                                            [object] => 10pm
                                            [objectSpan] => Array
                                                (
                                                    [0] => 8
                                                    [1] => 9
                                                )

                                        )

                                    [1] => Array
                                        (
                                            [subject] => I
                                            [subjectSpan] => Array
                                                (
                                                    [0] => 0
                                                    [1] => 1
                                                )

                                            [relation] => will meet
                                            [relationSpan] => Array
                                                (
                                                    [0] => 1
                                                    [1] => 3
                                                )

                                            [object] => Mary in New York
                                            [objectSpan] => Array
                                                (
                                                    [0] => 3
                                                    [1] => 7
                                                )

                                        )

                                    [2] => Array
                                        (
                                            [subject] => I
                                            [subjectSpan] => Array
                                                (
                                                    [0] => 0
                                                    [1] => 1
                                                )

                                            [relation] => will meet
                                            [relationSpan] => Array
                                                (
                                                    [0] => 1
                                                    [1] => 3
                                                )

                                            [object] => Mary
                                            [objectSpan] => Array
                                                (
                                                    [0] => 3
                                                    [1] => 4
                                                )

                                        )

                                    [3] => Array
                                        (
                                            [subject] => Mary
                                            [subjectSpan] => Array
                                                (
                                                    [0] => 3
                                                    [1] => 4
                                                )

                                            [relation] => is in
                                            [relationSpan] => Array
                                                (
                                                    [0] => 4
                                                    [1] => 5
                                                )

                                            [object] => New York
                                            [objectSpan] => Array
                                                (
                                                    [0] => 5
                                                    [1] => 7
                                                )

                                        )

                                )

                            [tokens] => Array
                                (
                                    [0] => Array
                                        (
                                            [index] => 1
                                            [word] => I
                                            [originalText] => I
                                            [lemma] => I
                                            [characterOffsetBegin] => 0
                                            [characterOffsetEnd] => 1
                                            [pos] => PRP
                                            [ner] => O
                                            [before] =>
                                            [after] =>
                                        )

                                    [1] => Array
                                        (
                                            [index] => 2
                                            [word] => will
                                            [originalText] => will
                                            [lemma] => will
                                            [characterOffsetBegin] => 2
                                            [characterOffsetEnd] => 6
                                            [pos] => MD
                                            [ner] => O
                                            [before] =>
                                            [after] =>
                                        )

                                    [2] => Array
                                        (
                                            [index] => 3
                                            [word] => meet
                                            [originalText] => meet
                                            [lemma] => meet
                                            [characterOffsetBegin] => 7
                                            [characterOffsetEnd] => 11
                                            [pos] => VB
                                            [ner] => O
                                            [before] =>
                                            [after] =>
                                        )

                                    [3] => Array
                                        (
                                            [index] => 4
                                            [word] => Mary
                                            [originalText] => Mary
                                            [lemma] => Mary
                                            [characterOffsetBegin] => 12
                                            [characterOffsetEnd] => 16
                                            [pos] => NNP
                                            [ner] => PERSON
                                            [before] =>
                                            [after] =>
                                        )

                                    [4] => Array
                                        (
                                            [index] => 5
                                            [word] => in
                                            [originalText] => in
                                            [lemma] => in
                                            [characterOffsetBegin] => 17
                                            [characterOffsetEnd] => 19
                                            [pos] => IN
                                            [ner] => O
                                            [before] =>
                                            [after] =>
                                        )

                                    [5] => Array
                                        (
                                            [index] => 6
                                            [word] => New
                                            [originalText] => New
                                            [lemma] => New
                                            [characterOffsetBegin] => 20
                                            [characterOffsetEnd] => 23
                                            [pos] => NNP
                                            [ner] => LOCATION
                                            [before] =>
                                            [after] =>
                                        )

                                    [6] => Array
                                        (
                                            [index] => 7
                                            [word] => York
                                            [originalText] => York
                                            [lemma] => York
                                            [characterOffsetBegin] => 24
                                            [characterOffsetEnd] => 28
                                            [pos] => NNP
                                            [ner] => LOCATION
                                            [before] =>
                                            [after] =>
                                        )

                                    [7] => Array
                                        (
                                            [index] => 8
                                            [word] => at
                                            [originalText] => at
                                            [lemma] => at
                                            [characterOffsetBegin] => 29
                                            [characterOffsetEnd] => 31
                                            [pos] => IN
                                            [ner] => O
                                            [before] =>
                                            [after] =>
                                        )

                                    [8] => Array
                                        (
                                            [index] => 9
                                            [word] => 10pm
                                            [originalText] => 10pm
                                            [lemma] => 10pm
                                            [characterOffsetBegin] => 32
                                            [characterOffsetEnd] => 36
                                            [pos] => CD
                                            [ner] => TIME
                                            [normalizedNER] => T22:00
                                            [before] =>
                                            [after] =>
                                            [timex] => Array
                                                (
                                                    [tid] => t1
                                                    [type] => TIME
                                                    [value] => T22:00
                                                )

                                        )

                                )

                        )

                )

        )

```

Any questions?
--------------

[](#any-questions)

Please let me know.

Credits
-------

[](#credits)

Some functions are forked from this "Stanford parser" package:

```
 https://github.com/agentile/PHP-Stanford-NLP

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~257 days

Total

4

Last Release

2662d ago

Major Versions

4.0.0 → 5.2.02017-01-22

5.3.0 → 7.1.02019-01-28

PHP version history (2 changes)4.0.0PHP &gt;=5.3.0

5.2.0PHP &gt;=5.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/ecf47b59f20e487b92ee5648a96da7a4551bb548213dc753918f3517279121e8?d=identicon)[DennisDeSwart](/maintainers/DennisDeSwart)

---

Top Contributors

[![DennisDeSwart](https://avatars.githubusercontent.com/u/9338304?v=4)](https://github.com/DennisDeSwart "DennisDeSwart (63 commits)")

---

Tags

composercorenlp-serverlemmanernlpopeniestanford-corenlptokenizerparserposnlpnerstanford

### Embed Badge

![Health badge](/badges/dennis-de-swart-php-stanford-corenlp-adapter/health.svg)

```
[![Health](https://phpackages.com/badges/dennis-de-swart-php-stanford-corenlp-adapter/health.svg)](https://phpackages.com/packages/dennis-de-swart-php-stanford-corenlp-adapter)
```

###  Alternatives

[agentile/php-stanford-nlp

PHP interface to Stanford NLP Tools

16557.1k](/packages/agentile-php-stanford-nlp)[paquettg/php-html-parser

An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.

2.4k7.9M123](/packages/paquettg-php-html-parser)[thadafinser/user-agent-parser

UserAgent parsing done right http://useragent.mkf.solutions/

249316.9k2](/packages/thadafinser-user-agent-parser)[vipnytt/sitemapparser

XML Sitemap parser class compliant with the Sitemaps.org protocol.

772.2M10](/packages/vipnytt-sitemapparser)[patrickschur/stanford-nlp-tagger

PHP wrapper for the Stanford Natural Language Processing library. Supports POSTagger and CRFClassifier.

7426.7k1](/packages/patrickschur-stanford-nlp-tagger)[phanan/poddle

Parse podcast feeds with PHP following PSP-1 Podcast RSS Standard

1721.4k1](/packages/phanan-poddle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
