Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(v4): upgrade corenlp to v4.2.0 #13

Merged
merged 1 commit into from
Apr 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>org.exist-db</groupId>
<artifactId>stanford-nlp</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.7.0-SNAPSHOT</version>

<name>Stanford Natural Language Processing</name>
<description>Integrates the Stanford CoreNLP annotation pipeline library into eXist-db.</description>
Expand Down Expand Up @@ -64,7 +64,7 @@
<exist.version>5.0.0</exist.version>
<node.version>v12.22.1</node.version>
<npm.version>7.9.0</npm.version>
<corenlp.version>3.9.2</corenlp.version>
<corenlp.version>4.2.0</corenlp.version>
<!-- See polymer-cli documentation -->
<browser.support>es5-bundled</browser.support>

Expand Down
4 changes: 2 additions & 2 deletions src/main/polymer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/main/polymer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polymer-starter-kit",
"version": "0.6.0-SNAPSHOT",
"version": "0.7.0-SNAPSHOT",
"description": "A starting point for Polymer apps",
"author": "The Polymer Authors",
"license": "BSD-3-Clause",
Expand Down
1 change: 1 addition & 0 deletions src/main/xar-resources/modules/load-language.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import module namespace console = "http://exist-db.org/xquery/console";
import module namespace functx = "http://www.functx.com";
import module namespace util = "http://exist-db.org/xquery/util";
import module namespace map = "http://www.w3.org/2005/xpath-functions/map";
import module namespace xmldb = "http://exist-db.org/xquery/xmldb";

declare function ll:mkcol-recursive($collection, $components) {
if (exists($components)) then
Expand Down
15 changes: 8 additions & 7 deletions src/main/xar-resources/modules/load-languages.xq
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
xquery version "3.1";

import module namespace ll = "http://exist-db.org/xquery/stanford-nlp/load-language" at "load-language.xqm";
import module namespace config = "http://exist-db.org/apps/stanford-nlp/config";


let $paths := (
"http://nlp.stanford.edu/software/stanford-english-corenlp-2018-10-05-models.jar",
"http://nlp.stanford.edu/software/stanford-english-kbp-corenlp-2018-10-05-models.jar",
"http://nlp.stanford.edu/software/stanford-arabic-corenlp-2018-10-05-models.jar",
"http://nlp.stanford.edu/software/stanford-chinese-corenlp-2018-10-05-models.jar",
"http://nlp.stanford.edu/software/stanford-french-corenlp-2018-10-05-models.jar",
"http://nlp.stanford.edu/software/stanford-german-corenlp-2018-10-05-models.jar",
"http://nlp.stanford.edu/software/stanford-spanish-corenlp-2018-10-05-models.jar",
$config:corenlp-model-url || "arabic.jar",
$config:corenlp-model-url || "chinese.jar",
$config:corenlp-model-url || "english.jar",
$config:corenlp-model-url || "english-kbp.jar",
$config:corenlp-model-url || "french.jar",
$config:corenlp-model-url || "german.jar",
$config:corenlp-model-url || "spanish.jar",
()
)

Expand Down
3 changes: 2 additions & 1 deletion src/main/xar-resources/modules/schedule-language.xq
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
xquery version "3.1";

import module namespace scheduler = "http://exist-db.org/xquery/scheduler";
import module namespace config = "http://exist-db.org/apps/stanford-nlp/config";

let $param := <parameters><param name="path" value="http://nlp.stanford.edu/software/stanford-chinese-corenlp-2018-10-05-models.jar"/></parameters>
let $param := <parameters><param name="path" value="{$config:corenlp-model-url || 'chinese.jar'}"/></parameters>

return scheduler:schedule-xquery-periodic-job("/db/apps/stanford-nlp/module/schedule-load.xq", 500, "load chinese", $param, 500, 0)
3 changes: 2 additions & 1 deletion src/main/xar-resources/modules/schedule-load.xq
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
xquery version "3.1";

import module namespace ll = "http://exist-db.org/xquery/stanford-nlp/load-language" at "load-language.xqm";
import module namespace config = "http://exist-db.org/apps/stanford-nlp/config";

declare variable $local:path external := "http://nlp.stanford.edu/software/stanford-english-corenlp-2018-10-05-models.jar";
declare variable $local:path external := $config:corenlp-model-url || 'english.jar';

ll:process($local:path)
5 changes: 4 additions & 1 deletion src/main/xquery/config.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ declare variable $config:repo-descriptor := doc(concat($config:app-root, "/repo.

declare variable $config:expath-descriptor := doc(concat($config:app-root, "/expath-pkg.xml"))/expath:package;


declare variable $config:data-root := concat($config:app-root, "/data");

(: TODO(DP): use maven templating to construct version here :)
declare variable $config:corenlp-version := '4.2.0';
declare variable $config:corenlp-model-url := 'http://nlp.stanford.edu/software/stanford-corenlp-' || $config:corenlp-version ||'-models-';

(:~
: Resolve the given path using the current application context.
: If the app resides in the file system,
Expand Down
8 changes: 4 additions & 4 deletions xar-assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,24 @@
<dependencySet>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.9.2</version>
<version>${corenlp.version}</version>
</dependencySet>
<dependencySet>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.9.2</version>
<version>${corenlp.version}</version>
<classifier>models</classifier>
</dependencySet>
<!-- <dependencySet>-->
<!-- <groupId>edu.stanford.nlp</groupId>-->
<!-- <artifactId>stanford-corenlp</artifactId>-->
<!-- <version>3.9.2</version>-->
<!-- <version>${corenlp.version}</version>-->
<!-- <classifier>models-english</classifier>-->
<!-- </dependencySet>-->
<!-- <dependencySet>-->
<!-- <groupId>edu.stanford.nlp</groupId>-->
<!-- <artifactId>stanford-corenlp</artifactId>-->
<!-- <version>3.9.2</version>-->
<!-- <version>${corenlp.version}</version>-->
<!-- <classifier>models-english-kbp</classifier>-->
<!-- </dependencySet>-->
<dependencySet>
Expand Down