You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A full traceback is shown for trying to e.g. train on a nonexistent path:
$ annif train tfidf-fi nonexistent_path
...
File "/home/local/jmminkin/git/Annif/annif/corpus/document.py", line 65, in documents
with opener(self.path) as tsvfile:
FileNotFoundError: [Errno 2] No such file or directory: 'nonexistent_path'
Similarly for trying to train without a path:
$ annif train tfidf-fi
...
File "/home/local/jmminkin/git/Annif/annif/cli.py", line 53, in open_documents
docs = open_doc_path(paths[0])
IndexError: tuple index out of range
The first case could be resolved by adding exists=True argument to type=click.Path(). This (at least alone) does not work in the second case, for which maybe required=True could be used, but the Note on Non-Empty Variadic Arguments should be considered.
Similar tracebacks arise when using:
train
learn
eval
optimize
For some reason index behaves differently:
It gives proper error when not given a path:
$ annif index tfidf-fi
Usage: annif index [OPTIONS] PROJECT_ID DIRECTORY
Try "annif index --help" for help.
Error: Missing argument "DIRECTORY".
It does not produce any output or error with nonexistent path:
$ annif index tfidf-fi nonexistent
$
The text was updated successfully, but these errors were encountered:
The note on required file arguments makes a good point.
I've sometimes (when testing VW based backends that support online learning) used a command like
annif train vw-multi /dev/null
The idea is to create an empty model which can then be trained incrementally.
I think annif train vw-multi (without a file argument) should do the same as the above, but perhaps emit an info message about creating an empty model. I'm unsure what this would do with non-VW backend though - probably there should be an error because creating an empty tfidf or fasttext model doesn't make sense.
A full traceback is shown for trying to e.g. train on a nonexistent path:
Similarly for trying to train without a path:
The first case could be resolved by adding
exists=True
argument totype=click.Path()
. This (at least alone) does not work in the second case, for which mayberequired=True
could be used, but the Note on Non-Empty Variadic Arguments should be considered.Similar tracebacks arise when using:
For some reason
index
behaves differently:The text was updated successfully, but these errors were encountered: