Commit 4f555073 authored by remivantrijp's avatar remivantrijp

Minor changes.

parent 3ca8895c
......@@ -59,4 +59,4 @@
:weights? t :render-program "circo")
"")
" in "
,(if (eq (direction cip) '->) "formulation" "comprehension"))))
\ No newline at end of file
,(if (eq (direction cip) '->) "formulation" "comprehension"))))
......@@ -40,77 +40,60 @@
;; ---------------------------------------------------------------
(clause ()
(referent ?ref)
(syn-cat ((clause-type ?clause-type)
(is-matrix-clause ?plus-or-minus))))
(syn-cat ((is-matrix-clause ?plus-or-minus))))
(matrix-clause (clause)
(syn-cat ((is-matrix-clause +))))
(subclause (clause)
(syn-cat ((is-matrix-clause -)
(agreement ?agreement))))
(intransitive-clause (clause)
(syn-cat ((clause-type intransitive))))
(transitive-clause (clause)
(syn-cat ((clause-type transitive))))
(ditransitive-clause (transitive-clause)
(syn-cat ((clause-type ditransitive))))
(syn-cat ((is-matrix-clause -))))
;; Phrases
;; ---------------------------------------------------------------
(phrase ()
(referent ?ref)
(parent ?parent)
(head ?head)
(syn-cat ((phrase-type ?phrase-type)
(agreement ?agreement))))
(agreement ?agreement))))
(NP (phrase)
(syn-cat ((phrase-type NP)))
(sem-cat ((sem-function referring-expression))))
(dativenp (NP)
(sem-cat ((sem-function referring-expression)
(sem-role dative))))
(syn-cat ((phrase-type NP))))
(advp (phrase)
(syn-cat ((phrase-type AdvP))))
(PrepNP (NP)
(syn-cat ((phrase-type PrepNP))))
(by-phrase (PrepNP)
(syn-cat ((is-by-phrase +))))
(syn-cat ((case by-phrase))))
(AdjP (phrase)
(syn-cat ((phrase-type AdjP)))
(sem-cat ((sem-function modifying-expression))))
(syn-cat ((phrase-type AdjP))))
(object-complement (phrase)
(syn-cat ((phrase-type Object-Complement))))
(VP (phrase)
(ev-args (?ref-ev ?perf-ev ?asp-ev ?ev))
(head ?verb)
(sem-cat ((sem-function predicating-expression)))
(syn-cat ((phrase-type VP)
(tam ((tense ?tense)
(aspect ((perfect ?perf)
(progressive ?prog)))
(modality ?mod))))))
(referent ?ev-ref)
(tam ((tense ?tense)
(aspect ((perfect ?perfect)
(progressive ?prog)))
(modality ?modality)))
(syn-cat ((phrase-type VP))))
;; Mixtures
;; ---------------------------------------------------------------
(clausal-subject (subclause NP))
;; Lex-classes
;; ---------------------------------------------------------------
(verb ()
(syn-cat ((agreement ?agr))))
;(tam ?tam)
;(verb-form ?verb-form)
;(finite ?finite))))
(syn-cat ((agreement ?agr)
(finite ?finite)
(verb-form ?verb-form))))
(aux (verb)
(syn-cat ((lex-class aux))))
(auxpass (aux)
(syn-cat ((is-passive-marker +)
(copula -))))
(syn-cat ((is-passive-marker +))))
(noun ()
(referent ?ref)
(args (?output ?input))
(sem-cat ((sem-class identifier)))
(syn-cat ((agreement ?agr))))
(common-noun (noun)
(syn-cat ((lex-class common-noun))))
(compound (noun))
(proper-noun (noun)
(syn-cat ((lex-class proper-noun))))
(syn-cat ((lex-class proper-noun))))
(adjective ()
(referent ?ref)
(args (?output ?input))
......@@ -120,14 +103,13 @@
(args (?ref ?input))
(syn-cat ((lex-class determiner))))
(article (determiner)
(syn-cat ((lex-class article))))
))
(syn-cat ((lex-class article))))))
;;; 2. Definition of a CATEGORY-SPEC.
;;; ------------------------------------------------------------------------------
;;; A category-spec is a triplet of the form (category-name (parents) (fv-pairs)).
;;; The feature-value pairs of the category-spec are meant to be the VALUE of a
;;; feature in the construction, such as SYN-CAT. Overwritting a value only goes
;;; feature in the construction, such as SYN. Overwritting a value only goes
;;; one level deep.
(defun category-name (category-spec)
......
......@@ -103,7 +103,7 @@
(defun dependency-string-append-named-entities (dependency-tree)
(let* ((utterance (nlp-tools:dp-build-utterance-from-dependency-tree dependency-tree))
(named-entities (get-penelope-named-entities-without-cardinals-and-dates utterance)))
(named-entities (get-penelope-named-entities-without-cardinals utterance)))
(loop for named-entity in named-entities
when (find #\space named-entity) ;; Composed of multiple parts.
do (setf dependency-tree (nlp-tools::dp-combine-tokens-in-dependency-analysis
......
......@@ -26,6 +26,7 @@
get-penelope-pos-tags
run-penelope-dependency-parser
get-penelope-dependency-analysis
get-penelope-dependency-analyses
get-penelope-tokens
get-penelope-sentence-tokens
get-penelope-text-tokens
......@@ -220,9 +221,11 @@ of strings, each list corresponding to a named entity."
(defun get-penelope-dependency-analysis (utterance &key (model "en"))
"Returns a dependency tree analysis."
(rest (assoc :tree (first (rest (assoc :dependencies (run-penelope-dependency-parser utterance :model model)))))))
;;(get-penelope-dependency-analysis "April is the fourth month of the year")
(defun get-penelope-dependency-analyses (utterances &key (model "en"))
"Returns dependency tree analyses of text consisting of multiple sentences."
(rest (assoc :dependencies (run-penelope-dependency-parser utterances :model model))))
;; Word embeddings ;;
;;;;;;;;;;;;;;;;;;;;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment