From 071ad7be76fd96a2ed733d7a581ac04e361c1d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D0=B8=D1=80?= Date: Tue, 10 Jan 2023 18:24:20 +0300 Subject: [PATCH] some fixes --- nlp_libpython/INSTALL_MLW.txt | 1 + nlp_libpython/project.clj | 2 +- nlp_libpython/src/nlp_libpython_spacy/core.clj | 6 +++--- nlp_libpython/test/nlp_libpython_spacy/core_test.clj | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/nlp_libpython/INSTALL_MLW.txt b/nlp_libpython/INSTALL_MLW.txt index c07af19..3fd690d 100644 --- a/nlp_libpython/INSTALL_MLW.txt +++ b/nlp_libpython/INSTALL_MLW.txt @@ -19,6 +19,7 @@ cd vi .profile # edit to add: export PATH=$PATH:~/bin lein python3 -m pip install numpy nltk spacy +python3 -m pip install transformers torch rm install-clojure # install Carin Meier's excellent examples for using many Python libraries: git clone https://github.com/gigasquid/libpython-clj-examples.git diff --git a/nlp_libpython/project.clj b/nlp_libpython/project.clj index 28dcd2e..069cce1 100644 --- a/nlp_libpython/project.clj +++ b/nlp_libpython/project.clj @@ -15,7 +15,7 @@ "clojars" {:url "https://clojars.org/repo"}} :dependencies [[org.clojure/clojure "1.10.1"] - [clj-python/libpython-clj "1.37"] + [clj-python/libpython-clj "2.023"] [clj-http "3.10.3"] [com.cemerick/url "0.1.1"] [org.clojure/data.csv "1.0.0"] diff --git a/nlp_libpython/src/nlp_libpython_spacy/core.clj b/nlp_libpython/src/nlp_libpython_spacy/core.clj index 8b8d3d3..6016622 100644 --- a/nlp_libpython/src/nlp_libpython_spacy/core.clj +++ b/nlp_libpython/src/nlp_libpython_spacy/core.clj @@ -1,6 +1,6 @@ (ns nlp-libpython-spacy.core - (:require [libpython-clj.require :refer [require-python]] - [libpython-clj.python :as py :refer [py. py.-]]) + (:require [libpython-clj2.require :refer [require-python]] + [libpython-clj2.python :as py :refer [py. py.-]]) (:require [knowledge-graph-navigator-clj.entity-text-by-uri :as kgn])) (require-python '[spacy :as sp]) @@ -66,4 +66,4 @@ (qa "what does Bill enjoy?" "Since last year, Bill lives in Seattle. He likes to skateboard.") (spacy-qa-demo "what is the population of Paris?") - (spacy-qa-demo "where does Bill Gates Work?")) + (spacy-qa-demo "where does Bill Gates work?")) \ No newline at end of file diff --git a/nlp_libpython/test/nlp_libpython_spacy/core_test.clj b/nlp_libpython/test/nlp_libpython_spacy/core_test.clj index 7cccb73..0a67daf 100644 --- a/nlp_libpython/test/nlp_libpython_spacy/core_test.clj +++ b/nlp_libpython/test/nlp_libpython_spacy/core_test.clj @@ -6,4 +6,4 @@ (test/deftest tokenization-test (test/testing "tokenization test" - (test/is (= 033 (count (sp/text->tokens test-text)))))) + (test/is (= 19 (count (sp/text->tokens test-text))))))