File tree Expand file tree Collapse file tree 2 files changed +1
-24
lines changed
Expand file tree Collapse file tree 2 files changed +1
-24
lines changed Original file line number Diff line number Diff line change 22Natural Language Processing
33
44Mathics3 Module module provides functions and variables to work with \
5- expressions in natural language, using the libraries:
5+ expressions in natural language, using the Python libraries:
66
77<ul>
88 <li><url>:spacy:
5656 WordData ,
5757 WordDefinition ,
5858 WordFrequency ,
59- WordFrequencyData ,
6059 WordList ,
6160 WordSimilarity ,
6261 WordStem ,
8786 "WordData" ,
8887 "WordDefinition" ,
8988 "WordFrequency" ,
90- "WordFrequencyData" ,
9189 "WordList" ,
9290 "WordSimilarity" ,
9391 "WordStem" ,
Original file line number Diff line number Diff line change @@ -265,27 +265,6 @@ def is_stop(word):
265265 return is_stop
266266
267267
268- class WordFrequencyData (_SpacyBuiltin ):
269- """
270- <dl>
271- <dt>'WordFrequencyData[$word$]'
272- <dd>returns the frequency of $word$ in common English texts.
273- </dl>
274- """
275-
276- # Mathematica uses the gargantuan Google n-gram corpus, see
277- # http://commondatastorage.googleapis.com/books/syntactic-ngrams/index.html
278-
279- def eval (self , word : String , evaluation : Evaluation , options : dict ) -> Real :
280- "WordFrequencyData[word_String, OptionsPattern[WordFrequencyData]]"
281- doc = self ._nlp (word .value , evaluation , options )
282- frequency = 0.0
283- if doc :
284- if len (doc ) == 1 :
285- frequency = math .exp (doc [0 ].prob ) # convert log probability
286- return Real (frequency )
287-
288-
289268class WordCount (_SpacyBuiltin ):
290269 """
291270 <dl>
You can’t perform that action at this time.
0 commit comments