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

SOLR-17023: Use Modern NLP Models via ONNX and Apache OpenNLP with Solr #1999

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f19f660
first version w bats test
epugh Oct 10, 2023
48fd37b
not positive I need this
epugh Oct 10, 2023
cecd4f6
new name, and OpenNLP is kind of a implmentation detail ;-).
epugh Oct 10, 2023
10abbd0
baby steps, found that packagesstore blows up killing solr when i pos…
epugh Oct 10, 2023
dd4cc89
remove resolutionStraregy force from gradle build..
epugh Oct 10, 2023
af18d0c
match name in the underlying OpenNLP project. bikeshedding!
epugh Oct 10, 2023
6950629
tidy
epugh Oct 10, 2023
1adba22
reorder params
epugh Oct 11, 2023
bcbf16d
log formatting
epugh Oct 11, 2023
e634b1c
regenerate...
epugh Oct 11, 2023
778e3f4
dynamically grab the models from hugging face.
epugh Oct 11, 2023
405153b
use logging structure for stack traces
epugh Oct 11, 2023
4e54090
download the correct jar, and document the work to remove this need i…
epugh Oct 13, 2023
9e30c29
Upgrade to OpenNLP 2.3.1 and related dependencies.
epugh Nov 27, 2023
ef9364a
no longer need workarounds for gpu/cpu issues with updated OpenNLP.
epugh Nov 27, 2023
08b3de8
Merge remote-tracking branch 'upstream/main' into SOLR-17023
epugh Nov 27, 2023
2c106e9
We cleaned up the name ;-)
epugh Dec 5, 2023
8112229
Merge branch 'main' into SOLR-17023
epugh Jan 9, 2024
8d6187f
prompted to update the locks
epugh Jan 9, 2024
50887bb
Add in required license files
epugh Jan 9, 2024
a31ef8e
lint
epugh Jan 9, 2024
4b7528a
precommit warning
epugh Jan 9, 2024
3a760da
Merge remote-tracking branch 'origin/main' into SOLR-17023
cpoerschke Feb 13, 2024
bdee568
upgrade OpenNLP from 2.3.1 to 2.3.2 (to match Lucene main branch)
cpoerschke Feb 13, 2024
541dceb
tentative: minimum Java17 for this PR
cpoerschke Feb 13, 2024
633391e
Update gradle-precommit.yml - Java 11 --> 17
cpoerschke Feb 13, 2024
e2fe1fe
Update solrj-test.yml - Java 11 --> 17
cpoerschke Feb 13, 2024
855b5ea
Update docker-test.yml - Java 11 --> 17
cpoerschke Feb 13, 2024
9c16a8b
Update bin-solr-test.yml - Java 11 --> 17
cpoerschke Feb 13, 2024
476a7d4
undo 'tentative: minimum Java17 for this PR' -- see PR 1510 instead
cpoerschke Feb 13, 2024
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
1 change: 1 addition & 0 deletions solr/licenses/onnxruntime-1.16.3.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ac414a0cbb03a36cf96b0467091263b8538c70df
21 changes: 21 additions & 0 deletions solr/licenses/onnxruntime-LICENSE-MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking up https://github.com/microsoft/onnxruntime/blob/v1.15.0/LICENSE here I noticed there's a 1.15.1 and 1.16.x now too, wondering about 1.15.0 vs. the later ones then.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

part-answering own question: OpenNLP 2.3.1 uses onnxruntime 1.15.0 - https://github.com/apache/opennlp/blame/opennlp-2.3.1/pom.xml#L176

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't specify the version of onnx, so maybe we poke them to update?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next opennlp will have 1.16.3 (or higher)


Copyright (c) Microsoft Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
314 changes: 314 additions & 0 deletions solr/licenses/opennlp-LICENSE-ASL.txt

Large diffs are not rendered by default.

101 changes: 101 additions & 0 deletions solr/licenses/opennlp-NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
Apache OpenNLP
Copyright 2021-2023 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

============================================================================

The snowball stemmers in
opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball
were developed by Martin Porter and Richard Boulton.
The full snowball package is available from
http://snowball.tartarus.org/

============================================================================

Wordpiece tokenizer
https://github.com/robrua/easy-bert

The MIT License (MIT)

Copyright (c) 2019 Rob Rua

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

============================================================================

ONNX Runtime

MIT License

Copyright (c) Microsoft Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

============================================================================

SLF4J API
https://github.com/qos-ch/slf4j

MIT License

Copyright (c) 2004-2022 QOS.ch Sarl (Switzerland)
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

============================================================================

jackson-databind
https://github.com/FasterXML/jackson-databind
The Apache Software License, Version 2.0
1 change: 1 addition & 0 deletions solr/licenses/opennlp-dl-2.3.2.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2196a4ffb5517bf04bb118a7646acd6147dafa60
1 change: 0 additions & 1 deletion solr/licenses/opennlp-tools-1.9.4.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/opennlp-tools-2.3.2.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d739edba1e729691ed5ab80e1ccf330555a02ea7
1 change: 1 addition & 0 deletions solr/modules/analysis-extras/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies {
implementation 'org.apache.lucene:lucene-core'
// NOTE: Need to stay on same version of opennlp-tools as lucene-analysis-opennlp
implementation 'org.apache.opennlp:opennlp-tools'
implementation 'org.apache.opennlp:opennlp-dl'
implementation 'org.slf4j:slf4j-api'

testImplementation project(':solr:test-framework')
Expand Down
Loading
Loading