Skip to content

Commit

Permalink
release 2024-08-09
Browse files Browse the repository at this point in the history
- add supersenses to WN-LMF export
- include marl as export prefix for DanNet dataset (new sentiment data)
  • Loading branch information
simongray committed Aug 9, 2024
1 parent ff90adc commit 63fbc81
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/wn_lmf_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
# based on the example from the https://github.com/goodmami/wn README
# (to clear db between restarts: rm ~/.wn_data/wn.db)

wn.add("../export/wn-lmf/dannet-wn-lmf.gz")
wn.add("../export/wn-lmf/dannet-wn-lmf.xml.gz")
ss = wn.synsets('vinde', pos='v')[0]
print(ss.definition())
print(ss.definition() + " (" + ss.lexfile() + ")")
2 changes: 1 addition & 1 deletion pages/releases-da.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Versioner
De nye DanNet-versioner bruger udgivelsesdatoen som versionsnummer, formateret som `YYYY-MM-DD`.

## **SNAPSHOT**: Supersenses + OEWN-opdatering
## **2024-08-09**: Supersenses + OEWN-opdatering
* Tilføjede 71055 Supersenses til DanNet, primært baseret på en mapping skabt til SemDaX-korporaet.
* Omkring 300 af disse er "rettet" efter hypernym til forskel fra mappingen.
* Yderligere 3793 af disse er blevet til på baggrund af en ny mapping af ikke-mappede synsets.
Expand Down
2 changes: 1 addition & 1 deletion pages/releases-en.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Releases
The newer DanNet releases use the release date as the version number, formatted as `YYYY-MM-DD`.

## **SNAPSHOT**: Supersenses + OEWN update
## **2024-08-09**: Supersenses + OEWN update
* Added 71055 Supersenses to DanNet, mostly based on a mapping devised for the SemDaX corpora.
* Around 300 of these were "fixed" according to hypernym, differing from the mapping.
* Another 3793 of these were created based on a new mapping of unmapped synsets.
Expand Down
4 changes: 2 additions & 2 deletions src/main/dk/cst/dannet/db/bootstrap.clj
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"2024-06-12")

(def current-release
(str "2024-06-12" "-SNAPSHOT"))
(str "2024-08-09" #_"-SNAPSHOT"))

(defn assert-expected-dannet-release!
"Assert that the DanNet `model` is the expected release to boostrap from."
Expand Down Expand Up @@ -351,7 +351,7 @@
This function survives between releases, but the functions it calls are all
considered temporary and should be deleted when the release comes."
[dataset]
(let [expected-release "2024-06-12-SNAPSHOT"]
(let [expected-release "2024-08-09"]
(assert (= current-release expected-release)) ; another check
(println "Applying release changes for" expected-release "...")

Expand Down
19 changes: 17 additions & 2 deletions src/main/dk/cst/dannet/db/export/wn_lmf.clj
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@
?synset skos:definition ?definition .
}"))

(def supersense-query
(op/sparql
"SELECT ?synset ?supersense
WHERE {
?synset dns:supersense ?supersense .
}"))

(def pos-str
{:wn/adjective "a"
:wn/noun "n"
Expand All @@ -163,9 +170,10 @@

(defn synset
[synset-props [id ms]]
(let [{:keys [ili pos definition examples members]} (get synset-props id)]
(let [{:keys [ili pos definition lexfile examples members]} (get synset-props id)]
(into [:Synset (cond-> {:id (name id)
:members (str/join " " members)
:lexfile lexfile
:ili (or ili "") ; attr required by https://github.com/goodmami/wn
:partOfSpeech (or pos "")}) ; attr required by https://github.com/goodmami/wn
(when definition
Expand Down Expand Up @@ -239,6 +247,9 @@
definition-query-res (label-time
'definition-query-res
(q/run g definition-query))
supersense-query-res (label-time
'supersense-query-res
(q/run g supersense-query))
get-relations-res (label-time
'get-supported-relations
(get-supported-relations g))
Expand Down Expand Up @@ -278,7 +289,11 @@
(update-vals
(group-by '?synset definition-query-res)
(fn [ms]
{:definition (-> ms first (get '?definition) str)})))]))
{:definition (-> ms first (get '?definition) str)}))
(update-vals
(group-by '?synset supersense-query-res)
(fn [ms]
{:lexfile (-> ms first (get '?supersense))})))]))

(defn xml-str
"Create a valid WN-LMF XML string from `query-results`."
Expand Down
2 changes: 1 addition & 1 deletion src/main/dk/cst/dannet/prefix.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
:resource (str "<" dannet-root "data>")
:export #{'dn 'dnc 'dns
'rdf 'rdfs 'owl
'wn 'ontolex 'skos 'lexinfo
'wn 'ontolex 'skos 'lexinfo 'marl
'dcat 'vann 'foaf 'dc
'ili 'en}
:download {"rdf" {:default "dannet.zip"
Expand Down

0 comments on commit 63fbc81

Please sign in to comment.