-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a6dc75
commit 5c5802c
Showing
6 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
echo "Running tests..." | ||
python -m pytest | ||
echo "Tests passed!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Tests | ||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
jobs: | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' # caching pip dependencies | ||
- name: Install Python dependencies | ||
uses: py-actions/py-dependency-install@v4 | ||
- name: Run pytest | ||
run: ./.github/scripts/run-tests.sh | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ twine | |
pylint | ||
pytest | ||
autopep8 | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ author_email = [email protected] | |
|
||
[options] | ||
install_requires = | ||
spacy>=3 | ||
spacy>=3.0.0,<4.0.0 | ||
loguru | ||
|
||
[options.entry_points] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import spacy | ||
|
||
def test_basic_load(): | ||
nlp = spacy.blank("en") | ||
p = nlp.add_pipe('dbpedia_spotlight') | ||
assert p != None | ||
assert 'dbpedia_spotlight' in nlp.pipe_names | ||
|
||
def test_load_vector(): | ||
nlp = spacy.blank("en") | ||
p = nlp.add_pipe('dbpedia_spotlight') | ||
assert p != None | ||
assert 'dbpedia_spotlight' in nlp.pipe_names | ||
doc = nlp("Google LLC is an American multinational technology company.") | ||
ents = doc.ents | ||
assert ents is not None | ||
assert len(ents) > 0 |