This is an automated email from the ASF dual-hosted git repository. cmeier pushed a commit to branch clojure-bert-qa-example in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
commit 3cdf9898f29520454a6b55d17ff6114a594adac6 Author: gigasquid <[email protected]> AuthorDate: Fri Apr 12 20:04:18 2019 -0400 computational complexity --- contrib/clojure-package/examples/bert-qa/src/bert_qa/core.clj | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/contrib/clojure-package/examples/bert-qa/src/bert_qa/core.clj b/contrib/clojure-package/examples/bert-qa/src/bert_qa/core.clj index e44ad40..079f227 100644 --- a/contrib/clojure-package/examples/bert-qa/src/bert_qa/core.clj +++ b/contrib/clojure-package/examples/bert-qa/src/bert_qa/core.clj @@ -17,9 +17,9 @@ (def model-vocab "model/vocab.json") ;; the input question #_(def input-q "When did BBC Japan start broadcasting?") -(def input-q "When did Herve serve as a Byzantine general?") + (def input-q "What branch of theoretical computer science deals with broadly classifying computational problems by difficulty and class of relationship?") ;;; the input answer -(def input-a "One of the first Norman mercenaries to serve as a Byzantine general was Hervé in the 1050s. By then however, there were already Norman mercenaries serving as far away as Trebizond and Georgia. They were based at Malatya and Edessa, under the Byzantine duke of Antioch, Isaac Komnenos. In the 1060s, Robert Crispin led the Normans of Edessa against the Turks. Roussel de Bailleul even tried to carve out an independent state in Asia Minor with support from the local population, [...] +(def input-a "Computational complexity theory is a branch of the theory of computation in theoretical computer science that focuses on classifying computational problems according to their inherent difficulty, and relating those classes to each other. A computational problem is understood to be a task that is in principle amenable to being solved by a computer, which is equivalent to stating that the problem may be solved by mechanical application of mathematical steps, such as an algorithm.") #_(def input-a (str "BBC Japan was a general entertainment Channel.\n" " Which operated between December 2004 and April 2006.\n" "It ceased operations after its Japanese distributor folded.")) @@ -74,8 +74,8 @@ (first))] (println "start-idx" start-idx "end-idx" end-idx) (if (> end-idx start-idx) - (subvec tokens (dec start-idx) (inc end-idx)) - (subvec tokens (dec end-idx) (inc end-idx)) ) + (subvec tokens start-idx (inc end-idx)) + (subvec tokens end-idx (inc end-idx)) ) )) (defn infer [ctx] @@ -135,5 +135,4 @@ (infer :cpu) - (get (:token2idx (get-vocab)) "[UNK]") )
