Commit 36545e9f authored by Jonathan Poalses's avatar Jonathan Poalses

finished, I think. Still have to seperate out the training and testing samples though...

parent 14af2ce2
...@@ -5,32 +5,6 @@ ...@@ -5,32 +5,6 @@
(:import [edu.stanford.nlp.coref CorefCoreAnnotations$CorefChainAnnotation])) (:import [edu.stanford.nlp.coref CorefCoreAnnotations$CorefChainAnnotation]))
(def example
"Great work, thanks for doing this!
Having had no previous experience with NLP libraries, I was wondering why I couldn’t get your examples to work. Then I realized that I had to download CoreNLP first from https://stanfordnlp.github.io/CoreNLP/ and add stanford-corenlp-4.4.0/* to the classpath. Everything worked fine after that.
Is this what you are supposed to do? It wasn’t mentioned in the readme, so I was wondering if I did something wrong here or if it is more obvious to people who have already worked with CoreNLP.")
(def test-sentence-one
"This is an example of correct language usage. I had an idea about using garlic butter with chicken, hence the food was burnt.")
(def test-sentence-two
"This is an example of incorrect language usage, due to the word why. I had an idea about using garlic butter with chicken, hence why the food was burnt.")
(def test-sentence-three
"This is an example of incorrect language usage. I had an idea about using garlic butter with chicken, hence why the food was burnt.")
(def test-sentence-four
"This is an example of incorrect language usage. I had an idea about using garlic butter with chicken, hence why the food was burnt. This one has an extra sentence to tip the balance to good.")
(def test-sentence-five
"This is an example of Californian slang. So, like, I had this great idea, where we put like, garlic butter with chicken, it's so rad.")
(def test-sentence-six
"This is all about like. I like lychees, they're delicious. Sometimes life is like watching paint dry, basically very boring")
(def test-sentence-seven
"This is a standard sample. It should not be defined as any dialect, therefore being recognised as standard.")
(def nlp (def nlp
(dl/->pipeline {:annotators ["truecase" (dl/->pipeline {:annotators ["truecase"
"quote" "quote"
...@@ -65,20 +39,16 @@ ...@@ -65,20 +39,16 @@
[sentence] [sentence]
(some american-words (dl/text (dl/tokens sentence)))) (some american-words (dl/text (dl/tokens sentence))))
(defn fake-test
[fake]
false)
;; Predicate vectors to check a sentence and see if it grammatically matches a dialect ;; Predicate vectors to check a sentence and see if it grammatically matches a dialect
(def australian-predicates (def australian-predicates
[fake-test australian-word-predicate]) [australian-word-predicate])
(def scottish-predicates (def scottish-predicates
[fake-test scottish-word-predicate]) [scottish-word-predicate])
(def american-predicates (def american-predicates
[fake-test american-word-predicate]) [american-word-predicate])
;; Take a sentence and figure out its dialect ;; Take a sentence and figure out its dialect
...@@ -119,6 +89,14 @@ ...@@ -119,6 +89,14 @@
(comment (comment
(def filedata (clojure.edn/read-string (slurp "all_samples.edn"))) (def filedata (clojure.edn/read-string (slurp "all_samples.edn")))
......
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