Add -V option to print spaCy version information
Change-Id: I1b196833c2100f1fcf3ce65db17536c1891894c7
diff --git a/README.md b/README.md
index fd615fc..ede7a7c 100644
--- a/README.md
+++ b/README.md
@@ -136,10 +136,27 @@
-h Display help message
-m MODEL Specify spaCy model (default: de_core_news_lg)
-L List available/installed models
+ -V Display spaCy version information
-d Disable dependency parsing (faster processing)
-g Disable GermaLemma (use spaCy lemmatizer only)
```
+### Version Information
+
+To check which version of spaCy and other components are installed:
+
+```shell
+docker run --rm korap/conllu-spacy -V
+```
+
+Example output:
+```
+=== spaCy Version Information ===
+spaCy version: 3.8.11
+GermaLemma version: 0.1.3
+Python version: 3.12.1
+```
+
### Environment Variables
You can customize processing behavior with environment variables:
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 0e45514..639e371 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -8,17 +8,18 @@
use_germalemma="True"
usage() {
- echo "Usage: $0 [-h] [-m MODEL] [-L] [-d] [-g]"
+ echo "Usage: $0 [-h] [-m MODEL] [-L] [-V] [-d] [-g]"
echo " -h Display this help message"
echo " -m MODEL Specify spaCy model (default: $model)"
echo " -L List available/installed models"
+ echo " -V Display spaCy version information"
echo " -d Disable dependency parsing (faster processing)"
echo " -g Disable GermaLemma (use spaCy lemmatizer only)"
exit 1
}
# Parse command line options
-while getopts "hm:Ldg" opt; do
+while getopts "hm:LVdg" opt; do
case $opt in
h)
usage
@@ -59,6 +60,25 @@
python /app/list_spacy_models.py
exit 0
;;
+ V)
+ echo "=== spaCy Version Information ===" >&2
+ python -c "import spacy; print(f'spaCy version: {spacy.__version__}')" >&2
+
+ # Check for GermaLemma
+ python -c "try:
+ import germalemma
+ try:
+ print(f'GermaLemma version: {germalemma.__version__}')
+ except AttributeError:
+ print('GermaLemma: installed (version unknown)')
+except ImportError:
+ print('GermaLemma: not installed')" >&2
+
+ # Show Python version
+ python -c "import sys; print(f'Python version: {sys.version.split()[0]}')" >&2
+
+ exit 0
+ ;;
d)
use_dependencies="False"
;;