25
votes
Programming of a natural language interface
OP seems to be mostly interested in Mathematica's built-in capabilities for grammar definition, parsing, and interpretation, but I think some of the questions asked can be seen and answered within a ...
13
votes
Accepted
Unscrambling jumbled anagrams
Edit In this edited version, the upper-case characters are treated as independent characters (you can easily adjust that) and, more importantly, the selection of all the anagrams is more efficient.
...
13
votes
Accepted
Number of capital letters
Using rhermans' testtext, I would propose this:
HammingDistance[testtext, ToLowerCase[testtext]] // RepeatedTiming
...
11
votes
Accepted
Removing banal words from a list
Please also see a related problem here, it might give you more ideas. Words can be banal wrt all words in the dictionary or wrt some particular list of words. Let's consider the later case. ...
10
votes
Accepted
How do I test that a string is a sentence?
Mathematica has the experimental (as of v12) function TextStructure which provides some guidance with this question, but things get tricky.
...
9
votes
How to find multi-word synonyms?
(Extended comment, not an answer. From the comments to it by OP I do no see the point expanding it further into full blown answer. Thanks to everyone who reacted to it...)
Procedure outline
Ingest ...
9
votes
How can I tell the WL auto-magic date interpreter to use a day-first interpretation if there is ambiguity?
To handle this problem, I wrote a new ResourceFunction called DateAmbiguityBreak. It piggybacks off ...
8
votes
Number of capital letters
It seems to me you are counting the number of different letters that apear as uppercase and not the total number of uppercase characters present. Here I use the UN Declaration of Human Rights without <...
8
votes
Accepted
Counting a part of the speech in a sentence
Length @ TextCases[
"The quick brown fox jumps over the lazy dog."
, "Noun"
]
2
Kuba♦
- 137k
8
votes
Accepted
8
votes
Accepted
8
votes
Accepted
A strange verb from Mathematica's WordList
Jokes aside, it indeed seems to be a verb in the English language. Look at this wiki entry:
Verb: aah (third-person singular simple present aahs, present participle aahing, simple past and past ...
7
votes
Accepted
Difference between free-form input via WolframAlpha[] and CTRL+=
Here is the summary from original M8 release page:
This guide should also be useful: Free-Form & External Input. While both things you mentioned are a part of integration of Wolfram|Alpha (W|A) ...
7
votes
Accepted
Manually plotting the 'sheep curve'
Here is how you can find out the info you need to make the plot
Consequently, the plot can be made with
ParametricPlot[f[t], {t, 0, 2 π}]
which gives
7
votes
Accepted
Searching words with the five vowels
lst = DictionaryLookup[{"Spanish",
x__ /; And @@ (StringCount[x, #] == 1 & /@ {"a", "e", "i", "o", "u"})}];
Short @ lst
{abrenuncio, aceituno, ...
7
votes
Split up word pairs in string based on semantic textual analysis
This is not really a solution, but a quick demonstration of trying to solve this problem with neural networks.
My approach is to take small snippets of text (ending up as fixed-size input) from a ...
6
votes
Split up word pairs in string based on semantic textual analysis
I didn't check for speed, but one possibility is:
...
5
votes
Accepted
Named entity recognition
As mentioned in the comments, Mathematica v12 has indeed named entity recognition via the TextContents command. Details in the documentation.
5
votes
Can WordFrequencyData run faster?
You can sped it up a bit. Do NOT Map. If function can take lists - go with that functionality. Take 100 words sample:
sample:=RandomSample[WordList[],100]
and ...
4
votes
Number of capital letters
On my system (v10.1 under Windows) RegularExpression is not quite as fast as HammingDistance but arguably it is more flexible, ...
4
votes
Accepted
Bigrams and TF-IDF calculation
What do you think about skipping the StringJoin and storing a bigram as a pair of strings?
...
4
votes
Accepted
Specify NetEncode's tokenization model?
You should use GloVe as the weights in EmbeddingLayer, not in the NetEncoder.
...
4
votes
Accepted
Average length (in words) of paragraphs in document
How picky are you about what counts as a word?:
...
3
votes
Average length (in words) of paragraphs in document
No need for averegL[#] & and WordCount[#] &. averegL and ...
3
votes
Bigrams and TF-IDF calculation
I've implemented the Bigrams and TF-IDF calculation
according to @Henrik Schumacher suggestion (see the attached code). Thanks a lot, @Henrik Schumacher.
...
3
votes
3
votes
Accepted
How to identify gender and family roles of characters in novel excerpts?
All functions attempted by OP are experimental. That said, the particular workflow of OP using EntityRegister / EntityStore probably should be expected to work. (...
3
votes
Accepted
Assigning probabilities to an Autocomplete function
QUICK TAKE
You can make use of WordFrequencyData and define
...
3
votes
Accepted
Entering natural language input in WolframScript
This can be done by using Interpreter with SemanticExpression:
Interpreter["SemanticExpression"]["population of Switzerland"]
It can also be ...
3
votes
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
natural-language × 51string-manipulation × 12
machine-learning × 10
text × 8
neural-networks × 4
wolfram-alpha-queries × 4
linguistics × 4
entity × 3
plotting × 2
list-manipulation × 2
functions × 2
image-processing × 2
data × 2
core-language × 2
associations × 2
curated-data × 2
date-and-time × 2
geography × 2
language-design × 2
parsing × 2
free-form-input × 2
dictionary × 2
interpreter × 2
nlp × 2
equation-solving × 1