Add gender tagger and make annotations configurable
Change-Id: I10f597c78e0f086a40d74a57292e4dc83c775484
Signed-off-by: Marc Kupietz <kupietz@ids-mannheim.de>
diff --git a/Makefile b/Makefile
index 137e731..0c73f3b 100644
--- a/Makefile
+++ b/Makefile
@@ -76,6 +76,11 @@
curl -sL -o $@ https://github.com/korap/korapxmltool/releases/latest/download/korapxmltool
chmod +x $@
+bin/conllu-gender:
+ mkdir -p bin
+ curl -sL -o $@ https://github.com/KorAP/conllu-gender/releases/latest/download/conllu-gender
+ chmod +x $@
+
$(KORAPXMLTOOL_MODELS_PATH)/de.marmot:
mkdir -p $(KORAPXMLTOOL_MODELS_PATH)
curl -sL -o $@ https://cistern.cis.lmu.de/marmot/models/CURRENT/spmrl/de.marmot
@@ -119,11 +124,14 @@
# %.ud.zip: %.zip
# $(KORAPXMLTOOL) $< | pv | ./scripts/udpipe2 | conllu2korapxml > $@
-KRILL_PREREQS := $(foreach base,$(BASENAMES),$(BUILD_DIR)/$(base).zip $(BUILD_DIR)/$(base).marmot-malt.zip $(BUILD_DIR)/$(base).tree_tagger.zip $(BUILD_DIR)/$(base).spacy.zip $(BUILD_DIR)/$(base).corenlp.zip $(BUILD_DIR)/$(base).opennlp.zip $(BUILD_DIR)/$(base).gender.zip)
+# Active annotation layers to run and package into Krill
+ANNOTATIONS ?= marmot-malt tree_tagger spacy corenlp opennlp
+
+KRILL_PREREQS := $(foreach base,$(BASENAMES),$(BUILD_DIR)/$(base).zip $(foreach ann,$(ANNOTATIONS),$(BUILD_DIR)/$(base).$(ann).zip))
pre-krill: check-src $(KRILL_PREREQS)
-$(BUILD_DIR)/%.krill.tar: $(BUILD_DIR)/%.zip $(BUILD_DIR)/%.marmot-malt.zip $(BUILD_DIR)/%.tree_tagger.zip $(BUILD_DIR)/%.spacy.zip $(BUILD_DIR)/%.corenlp.zip $(BUILD_DIR)/%.opennlp.zip $(BUILD_DIR)/%.gender.zip
+$(BUILD_DIR)/%.krill.tar: $(BUILD_DIR)/%.zip $(foreach ann,$(ANNOTATIONS),$(BUILD_DIR)/%.$(ann).zip)
$(KORAPXMLTOOL) --non-word-tokens -f -t krill -D $(BUILD_DIR) $(basename $<)*.zip
krill: $(foreach base,$(BASENAMES),$(BUILD_DIR)/$(base).krill.tar)
diff --git a/Readme.md b/Readme.md
index 6623d15..cd640ec 100644
--- a/Readme.md
+++ b/Readme.md
@@ -25,6 +25,7 @@
```
Then open the corresponding URL (e.g., http://localhost:64544) in your browser.
+
### Standard TEI P5 Support
Standard TEI P5 files (which typically contain one text per file) can be batch-converted together. By default, place your `.xml` files in the `TEI` directory in the root of the project:
@@ -59,6 +60,17 @@
make TEI_FLAGS='--xmlid-to-textsigle '\''([A-Z]+)\.(.*)\.([0-9]+)\.*([0-9])@$$1/$$2/$$3$$4'\'''
```
+### Configuring Active Annotators
+
+You can specify which annotation layers to run and package by setting the `ANNOTATIONS` variable. By default, it runs:
+`marmot-malt tree_tagger spacy corenlp opennlp`
+
+To enable gender annotation (using the `conllu-gender` tool), add `gender` to the list:
+
+```bash
+make ANNOTATIONS="marmot-malt tree_tagger spacy corenlp opennlp gender"
+```
+
## Prerequisites
* Java JRE 21 and