-
Notifications
You must be signed in to change notification settings - Fork 30
Notes on tests #117
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
base: master
Are you sure you want to change the base?
Notes on tests #117
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,7 +61,7 @@ def test_lemmatize_unicode(): | |
| annotators=['tokenize', 'ssplit', 'pos', 'lemma']) | ||
| saf = stanford_to_saf(lines) | ||
| assert_equal({t['lemma'] for t in saf['tokens']}, | ||
| {'Cesar', 'hit', 'Hovik'}) | ||
| {'Cesar', 'hit', 'Hovik'}) # | ||
|
|
||
|
|
||
| def test_ner(): | ||
|
|
@@ -92,7 +92,7 @@ def test_parse(): | |
| assert_equal(corefs, {tuple(sorted(['John', 'himself']))}) | ||
|
|
||
|
|
||
| def test_multiple_sentences(): | ||
| def test_multiple_sentences(): # | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to be testing CoreNLP more than xtas, maybe a bit too extensive.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's also checking whether stanford_to_saf preserves the information it gets from CoreNLP. |
||
| _check_corenlp() | ||
| p = parse("John lives in Amsterdam. He works in London") | ||
| saf = stanford_to_saf(p) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,7 +86,7 @@ def test_query_batch(): | |
| assert_equal(set(b), {"test", "test2"}) | ||
|
|
||
|
|
||
| def test_store_get_result(): | ||
| def test_store_get_result(): # | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be test deleting something, or does that never happen? |
||
| "test whether results can be stored and retrieved" | ||
| from xtas.tasks.es import ( | ||
| store_single, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,4 +94,4 @@ def test_frog_task(): | |
| assert_equal(tokens[0]['lemma'], 'dit') | ||
| saf = frog("dit is een test", output='saf') | ||
| assert_equal(len(saf['tokens']), 4) | ||
| assert_equal(saf['header']['processed'][0]['module'], 'frog') | ||
| assert_equal(saf['header']['processed'][0]['module'], 'frog') # | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we spot-check the output as well, like for the other output formats, to be a bit more sure that it worked as intended? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,7 @@ def test_pipeline(): | |
| s = "cats are furry" | ||
| expected = [('cats', 'NNS'), ('are', 'VBP'), ('furry', 'JJ')] | ||
| result = pos_tag(tokenize(s), 'nltk') | ||
| assert_equal(result, expected) | ||
| assert_equal(result, expected) # | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. First a check without the pipeline, then with, so you can easily see whether the pipeline is at fault or not. Nice! |
||
| with eager_celery(): | ||
| # do we get correct result from pipeline? | ||
| r = pipeline(s, [{"module": tokenize}, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the order reversed here relative to the input?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{}is set builder syntax, so the order is considered irrelevant. From the looks of stanford_to_saf output, the order shouldn't matter because each token carries an offset.