Hello Wolfram Community
I have trained a text classifier that understands a product description and puts the product in a category for example.
"Low Fat milk, 1000ml" -> Dairy
" Strawberry high protein yogurt"-> Dairy
" 1kg of red apples" -> Fruits
and so.
My classifier was built with the Classify function and I saved the model in a . wmlf Whenever I need to classify a bunch of products I just import as
MarkovClassifier =
Import["C:\\Users\\Amor_Rodrigo\\Desktop\\Latest\\Markov Classifier \
834.wmlf"]
and then just classify my list
MarkovClassifier[mylist]
That's it. As easy as that. My problem is that now that I need to implement this function in Python
I am trying something like this
from wolframclient.evaluation import WolframLanguageSession
from wolframclient.language import wlexpr
session=WolframLanguageSession()
classifierpath = r"C:\\Users\\Amor_Rodrigo\\Desktop\\Latest\\Markov Classifier 834.wmlf"
session.evaluate(wlexpr('MarkovClassifier=Import[classifierpath]'))
test= session.evaluate(wlexpr('Map[#^2 &, Range[5]]'))
print(test)
session. Terminate()
My output is this
First argument classifierpath is not a valid file, directory, or URL specification.
First argument classifierpath is not a valid file, directory, or URL specification.
(1, 4, 9, 16, 25)
Does anyone know how to import that classifier function and put it to work. ?
Any help will be really appreciated