Hello,
I'm trying to calculate cosine similarity using the "lsemantica" command, as I've seen referenced in a few settings including the paper- (https://carloschwarz.eu/wp-content/u.../lsa_stata.pdf) to compare text similarity between two variables (nursing terms and physician terms) in a dataset.
I'm starting using a very basic test data set with 2 variables and 11 observations that I created simply to ensure a proof of concept. After importing the data set, I am trying to run "lsemantica" and STATA displays a "command lsemantica is unrecognized." I am running Stata 19, BE, and my application is up to date. Here's a log file. I'm probably making some very silly elementary mistake- but welcome insight from the community.
. view "C:\Users\dfrac\AppData\Local\Temp\19997697-81c2-4b2b-b2b2-f2a51b85a98b_lsemantica(2).zip.lsemantica(2).zip\l semantica.sthlp"
. log using "C:\Users\dfrac\Documents\IRB - data work\Data test attempt 12-8-2025 v2.smcl"
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
name: <unnamed>
log: C:\Users\dfrac\Documents\IRB - data work\Data test attempt 12-8-2025 v2.smcl
log type: smcl
opened on: 8 Dec 2025, 22:46:27
. import excel "C:\Users\dfrac\Documents\IRB - data work\Data test.xlsx", sheet("Sheet1") firstrow
(2 vars, 11 obs)
. lsemantica nandaexample , components(4) tfidf min_char(3) min_freq(5) max_freq(0.5) name_new_var("component_")
command lsemantica is unrecognized
r(199);
. Thank you so much!
I'm trying to calculate cosine similarity using the "lsemantica" command, as I've seen referenced in a few settings including the paper- (https://carloschwarz.eu/wp-content/u.../lsa_stata.pdf) to compare text similarity between two variables (nursing terms and physician terms) in a dataset.
I'm starting using a very basic test data set with 2 variables and 11 observations that I created simply to ensure a proof of concept. After importing the data set, I am trying to run "lsemantica" and STATA displays a "command lsemantica is unrecognized." I am running Stata 19, BE, and my application is up to date. Here's a log file. I'm probably making some very silly elementary mistake- but welcome insight from the community.
. view "C:\Users\dfrac\AppData\Local\Temp\19997697-81c2-4b2b-b2b2-f2a51b85a98b_lsemantica(2).zip.lsemantica(2).zip\l semantica.sthlp"
. log using "C:\Users\dfrac\Documents\IRB - data work\Data test attempt 12-8-2025 v2.smcl"
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
name: <unnamed>
log: C:\Users\dfrac\Documents\IRB - data work\Data test attempt 12-8-2025 v2.smcl
log type: smcl
opened on: 8 Dec 2025, 22:46:27
. import excel "C:\Users\dfrac\Documents\IRB - data work\Data test.xlsx", sheet("Sheet1") firstrow
(2 vars, 11 obs)
. lsemantica nandaexample , components(4) tfidf min_char(3) min_freq(5) max_freq(0.5) name_new_var("component_")
command lsemantica is unrecognized
r(199);
. Thank you so much!

Comment