Commit 321fc08f authored by Jonathan Poalses's avatar Jonathan Poalses

added sample data and sample expected for ml stuff

parent cbad0673
This diff is collapsed.
This diff is collapsed.
("australian" "standard" "standard" "standard" "american" "standard" "standard" "american" "australian" "scottish" "australian" "scottish" "standard" "scottish" "scottish" "standard" "standard" "scottish" "standard" "american" "standard" "american" "standard" "standard" "scottish" "australian" "standard" "scottish" "australian" "scottish" "scottish" "standard" "american" "australian" "american" "standard" "american" "american" "american" "american" "australian" "american" "american" "american" "australian" "australian" "american" "american" "standard" "standard" "australian" "scottish" "australian" "standard" "standard" "scottish" "american" "australian" "american" "scottish" "australian" "australian" "australian" "australian" "american" "australian" "standard" "australian" "american" "australian" "scottish" "scottish" "scottish" "scottish" "scottish" "american" "standard" "scottish" "american" "standard" "scottish" "australian" "scottish" "australian" "australian" "standard" "american" "scottish" "standard" "standard" "american" "american" "australian" "scottish" "australian" "scottish" "scottish" "scottish" "australian" "american")
\ No newline at end of file
...@@ -87,6 +87,13 @@ ...@@ -87,6 +87,13 @@
(println (str (count (filter true? result-comparison)) "/" (count result-comparison) " correct."))))) (println (str (count (filter true? result-comparison)) "/" (count result-comparison) " correct.")))))
(defn generate-machine-data []
(let [filedata (clojure.edn/read-string (slurp "all_samples2.edn"))
data (str (keys filedata))
value (str (vals filedata))]
(spit "sample_data.txt" data)
(spit "sample_expected.txt" value)))
...@@ -99,10 +106,21 @@ ...@@ -99,10 +106,21 @@
(comment (comment
(def filedata (clojure.edn/read-string (slurp "all_samples.edn"))) (def filedata (clojure.edn/read-string (slurp "all_samples2.edn")))
(def key-results (map detect-sample-dialect (keys filedata))) (def key-results (map detect-sample-dialect (keys filedata)))
(def expected-results (map keyword (vals filedata))) (def expected-results (map keyword (vals filedata)))
(def datayaya (str (keys filedata)))
(def whyyaya (str (vals filedata)))
(def)
(println datayaya)
(println whyyaya)
(spit "sample_data.txt" datayaya)
(spit "sample_expected.txt" whyyaya)
(interleave key-results (map zero? (map compare key-results expected-results))) (interleave key-results (map zero? (map compare key-results expected-results)))
(zipmap (keys filedata) (map zero? (map compare key-results expected-results))) (zipmap (keys filedata) (map zero? (map compare key-results expected-results)))
......
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
(let [shutdown-trigger (promise) (let [shutdown-trigger (promise)
_bye-testing-hack (future (Thread/sleep 6000) (deliver shutdown-trigger true))] _bye-testing-hack (future (Thread/sleep 6000) (deliver shutdown-trigger true))]
(log/info "Dialect Detector started up.") (log/info "Dialect Detector started up.")
(nlp/generate-machine-data)
(nlp/detect-dialects (:filename options)) (nlp/detect-dialects (:filename options))
@shutdown-trigger @shutdown-trigger
(log/info "Dialect Detector shutting down...")) (log/info "Dialect Detector shutting down..."))
......
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