-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/refactor-tests-with-pytest' into…
… release/541 # Conflicts: # nlu/__init__.py # tests/nlu_hc_tests/component_tests/de_identification/de_identification_tests.py # tests/nlu_hc_tests/component_tests/generic_classifier/generic_classifier_tests.py
- Loading branch information
Showing
145 changed files
with
784 additions
and
4,644 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
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 @@ | ||
include VERSION |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
1.1.12 |
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,34 @@ | ||
package: | ||
name: nlu | ||
version: {{ environ.get('CODE_VERSION', '') }} | ||
|
||
app: | ||
entry: nlu | ||
summary: The power of 15000+ State-of-the-art pre-trained NLP models in 300 languages with 1 line of Python code. | ||
|
||
source: | ||
path: ../conda_src | ||
|
||
build: | ||
noarch: generic | ||
number: 0 | ||
script: "python3 -m pip install . --no-deps -vv" | ||
|
||
requirements: | ||
build: | ||
- python | ||
run: | ||
- python | ||
- pyspark==3.0.1 | ||
- spark-nlp >=5.2.0 | ||
- numpy | ||
- pyarrow >=0.16.0 | ||
- pandas >=1.3.5 | ||
- dataclasses | ||
about: | ||
home: https://nlu.johnsnowlabs.com/ | ||
license: Apache License 2.0 | ||
license_family: APACHE | ||
license_url: https://github.com/JohnSnowLabs/nlu/blob/master/LICENSE | ||
description: John Snow Labs' NLU is a Python library for applying state-of-the-art text mining, directly on any dataframe, with a single line of code. As a facade of the award-winning Spark NLP library, it comes with hundreds of pretrained models in tens of languages - all production-grade, scalable, and trainable. | ||
summary: The The power of 15000+ State-of-the-art pre-trained NLP models in 300 languages with 1 line of Python code. |
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,5 @@ | ||
[pytest] | ||
;markers = | ||
; db_cloud_node_params: marker for parameterizing databricks tests with cloud credentials and node types (azure,aws, gcp) | ||
; db_cloud_params: marker for parameterizing databricks tests over all cloud credentials (azure,aws, gcp) | ||
addopts = -s --capture=no |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import pytest | ||
|
||
from tests.utils import all_tests, one_per_lib, NluTest, model_and_output_levels_test | ||
|
||
|
||
def model_id(model_to_test: NluTest) -> str: | ||
return f"{model_to_test.test_group}_{model_to_test.nlu_ref}" | ||
|
||
|
||
def all_annotator_tests(): | ||
return all_tests | ||
|
||
|
||
def one_test_per_lib(): | ||
return one_per_lib | ||
|
||
|
||
@pytest.mark.skip(reason="Use run_tests.py instead until pytest-xdist issue is fixed") | ||
@pytest.mark.parametrize("model_to_test", all_annotator_tests(), ids=model_id) | ||
def test_model_all_annotators(model_to_test: NluTest): | ||
model_and_output_levels_test( | ||
nlu_ref=model_to_test.nlu_ref, | ||
lang=model_to_test.lang, | ||
test_group=model_to_test.test_group, | ||
output_levels=model_to_test.output_levels, | ||
input_data_type=model_to_test.input_data_type, | ||
library=model_to_test.library, | ||
pipe_params=model_to_test.pipe_params | ||
) | ||
|
||
|
||
@pytest.mark.skip(reason="Local testing") | ||
@pytest.mark.parametrize("model_to_test", one_test_per_lib(), ids=model_id) | ||
def test_one_per_lib(model_to_test: NluTest): | ||
model_and_output_levels_test( | ||
nlu_ref=model_to_test.nlu_ref, | ||
lang=model_to_test.lang, | ||
test_group=model_to_test.test_group, | ||
output_levels=model_to_test.output_levels, | ||
input_data_type=model_to_test.input_data_type, | ||
library=model_to_test.library, | ||
pipe_params=model_to_test.pipe_params | ||
) |
File renamed without changes.
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 was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
tests/nlu_core_tests/component_tests/albert_for_question_answering _tests.py
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,15 @@ | ||
import unittest | ||
import nlu | ||
|
||
|
||
|
||
def test_albert_for_question_answering(): | ||
pipe = nlu.load("en.answer_question.squadv2.albert.xxl.by_sultan", verbose=True) | ||
data = "What is my name?|||My name is CKL" | ||
df = pipe.predict( | ||
data, | ||
) | ||
for c in df.columns: | ||
print(df[c]) | ||
|
||
|
File renamed without changes.
Empty file.
29 changes: 0 additions & 29 deletions
29
tests/nlu_core_tests/component_tests/chunker_tests/chunk_tests.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.