SemanticExcel user manual

SemanticExcel is a web application for statistical analysis of text. It turns each text into a list of numbers, called a semantic representation. You then run tests and models on these numbers from a spreadsheet. You do not need to write code.

The numbers come from one of two kinds of models. A Hugging Face model is a transformer language model, such as a sentence-transformer or BERT. An LSA model is a semantic space made with latent semantic analysis.

This manual describes what the current version of the software does. Where we are not sure how a feature behaves, we say so.

Contents

  1. Getting started
  2. Creating a document
  3. The spreadsheet
  4. The functions, step by step
  5. Norms, predictions and spaces
  6. Advanced options
  7. How the statistics are computed and how to report them
  8. The API
  9. Troubleshooting and good practice
  10. Further reading
  11. The library of semantic measures

1. Getting started

Create an account

  1. Go to semanticexcel.com.
  2. Click Create an Account below the sign-in box.
  3. Fill in first name, last name, email address, username, password and language. All fields are required.
  4. Click Sign Up.

Each email address can hold one account. A new account starts with copies of the demo documents, so you have examples to look at.

Log in and log out

Sign in with your username and password on the front page. If you forget your password, click Forgot Password? and enter your email address. SemanticExcel works best in the Chrome web browser. Other browsers show a warning the first time.

The main page

After you log in, the main page lists your documents. A document is one spreadsheet. The list has these columns:

  • Name. Click it to open the document in a new tab.
  • Semantic space language and Space name. For a Hugging Face document, the space name column shows model and the model name.
  • Created. The date the document was made.
  • Delete. This removes the document after you confirm.
  • Export. EXLS downloads an Excel file and CSV downloads a CSV file.

The buttons below the list are Create Document, Import Sheet and Create Space. The list shows ten documents per page.

The menu bar at the top links to Home, Publications, and a Scales menu. The Scales menu holds All Predictions, My Predictions, All Norms, My Norms, All Spaces and My Spaces. The API page is also in the menu bar.

Size limits

Ordinary accounts can use a limited number of cells per document. The administrator sets this number. The spreadsheet shows the limit and a link named Apply for more cells. Use it if your data set is larger.

2. Creating a document

You can start with an empty document or import a sheet. Both forms ask you to choose a model. The model decides how texts become numbers, so choose it with care. The document keeps this model, and the forms offer no way to change it later. To use another model, make a new document. A single formula can also use another model through the parameter BERTname (see section 6).

Create an empty document

  1. Click Create Document.
  2. Type a name.
  3. Choose Hugging Face models or LSA models.
  4. Choose the model, as described below.
  5. Click Save changes.

Hugging Face models (the default)

A Hugging Face model knows its own languages, so you do not choose a language. The list holds models we recommend:

LanguageModel name on huggingface.coDescription
Many languagessentence-transformers/paraphrase-multilingual-mpnet-base-v2Multilingual sentence model, 50+ languages. This is the default.
sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2Multilingual sentence model, 50+ languages, small and fast
intfloat/multilingual-e5-baseMultilingual E5, 100 languages
xlm-roberta-baseXLM-RoBERTa, 100 languages
bert-base-multilingual-casedMultilingual BERT, 104 languages
Englishsentence-transformers/all-mpnet-base-v2English sentence model
answerdotai/ModernBERT-baseModernBERT
roberta-baseRoBERTa
bert-base-uncasedBERT
SwedishKBLab/sentence-bert-swedish-casedSwedish sentence model (KBLab)
KBLab/bert-base-swedish-casedSwedish BERT (KBLab)
Portugueseneuralmind/bert-base-portuguese-casedBrazilian Portuguese BERT (BERTimbau)

Sentence models are trained to compare the meaning of whole sentences. They are a good first choice for answers to open questions.

Search for another model. Type in the field Or search any model on huggingface.co. The field suggests models as you type. A name in this field wins over the list. The server accepts a model only if it has safetensors weights and needs no code of its own. Other models fail with an error.

First use. A model marked (on the server) starts at once. Any other model is downloaded the first time it is used. That first calculation can take several minutes. The server removes models that have not been used for a long time when it runs short of disk space. Such a model is downloaded again on the next use.

LSA models

Choose LSA models, then a language, then a space. The default LSA spaces were made from Google 5-grams. The space list also shows your own spaces and public spaces in that language.

The languages are Swedish, English, Norwegian, Spanish, Dutch, Romanian, Italian, German, French, Chinese, Czech, Finnish, Hebrew, Polish, Portuguese, Russian and Persian. Two spaces built from Facebook data are also listed. English has two default spaces, English 1 and English 2.

The language of the space must match the language of your texts. Words that are not in the space are ignored.

Import an Excel or CSV sheet

  1. Click Import Sheet.
  2. Choose a file of type .csv, .xlsx or .xls.
  3. Choose the model as above.
  4. Click Submit.

The document takes the name of the file. Only the first sheet of an Excel file is read. The largest file is 1 MB for ordinary accounts and 10 MB for administrators. The form shows your limit, and a larger file gives a message. Rows and columns beyond your cell limit are cut off.

How to lay out your data

  • Put one response in one cell. A response can be a word, a few words or a long text.
  • Put one participant or one observation in one row.
  • Put one variable in one column. For example, column A holds the texts and column B holds a rating scale.
  • Use the first row for column names. Start the data ranges in row 2, so the names are not analysed.
  • Keep numeric columns numeric. Use a dot as the decimal sign. Do not mix text and numbers in a column you will use as numbers.
  • Leave a cell empty when a value is missing.
  • A range in a function runs down one column, from a start cell to a last cell. The start cell and the last cell must be in the same column. Ranges that belong together must have the same length.

Example layout:

ABC
1harmony_textswls_totalgroup
2calm, balanced, peace, content, happy271
3stressed, busy, tired, worried, alone122
............

3. The spreadsheet

Parts of the page

  • The File menu holds Export to Excel.
  • The Functions menu opens the function dialog.
  • The document name and its model or space are shown next to the menus. Click the name to rename the document.
  • The Formula bar shows the content of the selected cell. You can type a formula there and press Enter.
  • The Add new column button adds a column.

Cells and ranges

Columns are named A, B, C and so on. Rows are numbered from 1. A cell is named by its column and row, such as A2. You type a value by selecting a cell and typing. You can paste data from another spreadsheet. You can drag a column border to make it wider.

A range is written as a start cell and a last cell, separated by a semicolon. A2;A51 means cells A2 to A51 in column A.

The right-click menu

  • Edit Formula opens the function dialog with the settings of the selected formula.
  • Show value shows the whole result of a cell in a window. Figures are shown here too.
  • Undo and Redo undo and redo your last edits.

Running a function

  1. Enter or import your data.
  2. Click an empty cell. The result will be written here.
  3. Open Functions. You must select a cell first, or the menu asks you to.
  4. Choose a function in the list on the left. A short description and the fields of the function appear.
  5. Fill in the fields. The formula at the top of the dialog updates as you type.
  6. Click OK. The formula is written into the selected cell.

The cell then shows Calculating... while the server works. Large data sets, and the first use of a new model, can take several minutes. Keep the page open. When the work is done, the cell shows the result.

Formulas and their syntax

The dialog writes the formula for you. You can also type or edit formulas yourself. The rules are:

  • A formula starts with =, followed by the function name and arguments in brackets.
  • Arguments are separated by semicolons ;. Do not use commas or colons.
  • Cell references are written without quotes, such as A2. A $ keeps a reference fixed when the formula is copied, such as $A$2. See Copying formulas.
  • Named options are written as pairs of quoted text, such as 'predictionname';'harmony'.
  • Function names do not depend on letter case.

Examples of formulas the dialog writes:

FormulaWhat it does
=Similarity(singletext;A2;B2)Semantic similarity between the texts in A2 and B2.
=Similarity(multipletext;A2;A51;B2;B51;C2;C51)Similarity row by row between A2:A51 and B2:B51, written into C2:C51.
=semanticTest(A2;A51;B2;B51)Semantic t-test between the texts in A2:A51 and B2:B51.
=keywordsTest(A2;A51;B2;B51;bonferroni)Keyword test with Bonferroni correction.
=train(A2;A51;B2;B51;'predictionname';'harmony')Trains a model that predicts B2:B51 from the texts in A2:A51, and saves it as harmony.
=Property(singletext;A2;PREDICT;harmony)Applies the saved model harmony to the text in A2.
=clusterSpace(A2;A51;5)Sorts the texts in A2:A51 into 5 clusters.
=AVG(B2;B51)Mean of B2:B51.

Settings from Advanced options are added at the end, as in 'parameters';'{"NleaveOuts":"10"}'.

Copying formulas

You can copy a formula to other cells in two ways. You can copy the cell and paste it into another cell. You can also drag the small square at the lower right corner of the selected cells, which fills the cells you drag over.

The cell references in the formula then move with it. If the formula in C2 is =Similarity(singletext;A2;B2) and you copy it to C3, it becomes =Similarity(singletext;A3;B3).

A dollar sign $ keeps a reference fixed, as in Excel. Put it before the column, before the row, or before both:

ReferenceCopied one row down and one column rightWhat stays fixed
A2B3Nothing
$A2$A3The column
A$2B$2The row
$A$2$A$2The column and the row

For example, write =Similarity(singletext;A2;$B$1) in C2 and drag it down to C51. Each cell then compares one text in column A with the same text in B1.

A reference that would move outside the sheet, such as above row 1, becomes #REF!. Text in double quotes, and named options such as 'predictionname';'harmony', are not changed. A formula copied from another program, such as Excel, is pasted as it is.

How results are written

  • A test or a model writes a summary into the formula cell. The summary is a list of named values, such as p, r and n, with a short explanation of each.
  • A long result does not fit in the cell. Right-click the cell and choose Show value to read it all.
  • Some functions also write one value per text into a range you choose. Examples are Similarity and Properties with multiple texts, Predict with multiple texts, the cross-validated predictions of Train, and the cluster numbers of Cluster.
  • Figures are shown with Show value. The window has a link to download the figure as a PNG file and as a MATLAB .fig file. It also shows a text that describes the method and the test results behind the figure.
  • A missing value is shown as an empty cell.
  • If the calculation fails, the cell shows Error during calculating.

Results are stored with the document. When you open the document again, the stored results are shown without a new calculation.

Saving

There is no save button. Every change to a cell is saved on the server at once.

Exporting

  • File, Export to Excel downloads an .xlsx file. Formula cells hold their result. The formula itself is kept as a comment on the cell.
  • The EXLS link on the main page gives the same Excel file.
  • The CSV link on the main page gives the same values as a CSV file. Formula cells hold their result.

4. The functions, step by step

The Functions dialog groups the functions as follows:

GroupFunction in the listFormula
MeasureSemantic similaritySimilarity
Properties of textsProperty
PredictProperty with PREDICT
AnalyseSemantic t-testsemanticTest
Semantic dimension testsemantictestpropertymany
Keyword testkeywordsTest
ClusterclusterSpace
Traintrain
VisualisePlotplotWordCloud
Plot text properties on x, y, z (shown after you click +)plotSpace
Word clouds and categories of data, Clusters (shown after you click +)plotWordcount
Numerical functionsSum, Average, Standard deviation, T-test, CorrelationSUM, AVG, STDEV, TTEST, corr

Most functions have an Advanced Options link at the bottom of the dialog. It holds extra fields for some functions, a filter for selecting texts, and the parameter settings described in section 6.

Select texts by a criterion

Under Advanced Options, most analysis and plot functions have the field Select texts with the following criteria. Type a condition such as x>2.3. Then give the start cell and last cell of a numeric column. Only rows where the value x in that column meets the condition are used. This field is not offered for Similarity, Properties, Predict, Sum and Average.

Semantic similarity

This function computes how close two texts are in meaning. The value is the cosine of the angle between the two semantic representations. It is near 1 for texts with the same meaning and near 0 for unrelated texts. It can be negative.

Single Text compares two cells:

  1. Choose Single Text.
  2. Type the first text cell in Text1 and the second in Text2.
  3. Click OK. The value is written in the selected cell.

Multiple Text compares two columns row by row:

  1. Choose Multiple Text.
  2. Give the start and last cell of Text1 and of Text2.
  3. Give the start and last cell under Store calculated values in.
  4. All three ranges must have the same length.

Compare with a norm. Choose a norm in Select norms. A norm is a stored text that stands for a concept, such as happiness. Text2 is then hidden, and each text is compared with the norm. The norm list shows your own norms and public norms in the language of the document. A short description of the norm is shown when you choose it. See section 5 for how to make norms.

Measure semantic distance by changes what is computed. The default is the semantic similarity. Other choices include:

ChoiceMeaning
semanticSimilarityCosine similarity between the two texts. This is the default.
mean, min, maxMean, smallest or largest value over the words in the text.
standarddeviationStandard deviation of the semantic similarity of the words.
sortword, sortwordLow2HighLists the words sorted from high to low, or low to high.
meanFullMean of the pairwise similarities between the words in the two texts.
semanticTestSemantic t-test on the words in the two texts.
chi2testChi-square test on the words in the two texts.
unionText, unionPercentageThe words in both texts, or the percentage of words in both texts.
mergeTexts, subtractTextsJoins two texts, or removes the words of the second text from the first.
pred2percentage, pred2zMaps a prediction to a percentage or to a z-value.

The list holds a few more choices without a description in the code. We do not describe them here.

Properties of texts

This function computes a property of a text, such as its number of words, or its value on a stored scale.

  1. Choose Single Text and give the text cell. Or choose Multiple Text and give a text range and an output range of the same length.
  2. Under Choose category of properties, choose a category.
  3. Under Choose an instance of the category, choose the property. The list is loaded from the server and can take a moment.
  4. Click OK.

The categories are:

CategoryWhat it holds
FunctionsBuilt-in measures of a text. See the next table.
ClustersClusters made with the Cluster function.
Prediction (from train)Models made with Train.
LIWCWord categories in the style of Linguistic Inquiry and Word Count.
Semantic dimensionsThe dimensions of the semantic space.
Semantic scalesStored semantic scales.
WordclassesWord classes, such as nouns and verbs.
Texts, Words, Stopwords, VariablesStored texts, words in the space, stop words, and stored variables.
NormsNorms made on the norms pages.

The contents of each category depend on the space or model of your document. The list shows at most 2000 entries. The Functions category holds measures such as these:

PropertyMeaning
nwordsNumber of words in the text.
nwordsfoundNumber of words in the text that are also found in the space.
frequency, logfrequencyMean frequency of the words (parts per million), or mean log frequency.
wordlengthMean number of characters per word.
sentencelengthNumber of words per sentence.
typetokenratioNumber of different words divided by the number of words.
associatesA list of words with the most similar semantic representations.
languagePositive values mean the text has the same language as the space.
coherenceA sliding window of the semantic difference over the text.
wordclassWord class of a single word. It does not work for longer texts.
spaceThe values of the text on all dimensions.

The third choice, Properties, computes a property of a stored entry rather than of a cell. We have not tested this mode, so we do not describe it further.

Predict

Predict applies a saved model to new texts. A model is made with Train.

  1. Choose Single Text and give the text cell. Or choose Multiple Text and give a text range and an output range of the same length.
  2. Under Choose variable to predict, choose a model. The list holds your own models and all public models. The description of the model is shown when you choose it.
  3. Click OK.

The list is not limited to models of your language or space. Choose a model that was trained with the same model or space as your document. Read its description to check what it predicts and how it was made.

Semantic t-test

The semantic t-test asks whether two sets of texts differ in meaning. An example is texts written by two groups, or texts written under two conditions.

  1. Under Texts 1, give the start and last cell of the first set.
  2. Under Texts 2, give the start and last cell of the second set.
  3. For a paired test, open Advanced Options and tick Paired semantic t-test. See the note below.
  4. Click OK.

The result holds these values, among others:

ValueMeaning
m1, m2, s1, s2Mean and standard deviation of the semantic scale in set 1 and set 2.
n1, n2Number of data points in set 1 and set 2.
t, pThe t-value and the one-tailed p-value.
zMean value divided by the standard deviation of the mean.
cohensDEffect size, Cohen's d.
correctShare of texts placed on the correct side of the scale.
semanticTestMethodPaired for a paired test, or Word subtraction for the independent test.

Paired tests. In a paired test, row 1 of Texts 1 belongs with row 1 of Texts 2, and so on. Both ranges must have the same length. The value semanticTestMethod in the result says Paired when the paired test was run.

Semantic dimension test

This function compares two or more sets of texts on several semantic properties at once. Each set has a data range, a properties start cell and an optional labels start cell. Click Add Set to add more sets. The result is a table with one row and one column per set. By default the cells hold p-values, or r and pCorrelation when correlations are computed.

We could not confirm from the code what the properties cells must hold. Test this function on a small example before you use it in a study.

Keyword test

The keyword test asks which words occur more often in one set of texts than in another.

  1. Give the start and last cell of Texts 1.
  2. Give the start and last cell of Texts 2.
  3. Choose the Correction for multiple comparisons: Bonferroni, Holm's, or None.
  4. Click OK.

The result holds the number of words and texts in each set (N1, N2, N1text, N2text), and the similarity of the two sets' word frequencies. It then lists keywords1, the words that are significantly more frequent in set 1, and keywords2, those more frequent in set 2. Further down it shows clusters of words that differ, and a table of the most common words with their statistics.

Texts 2 may be left empty. We believe set 1 is then compared with word frequencies in the language, but we have not confirmed this.

Cluster

Cluster sorts texts into groups with similar meaning, using k-means on the semantic representations.

  1. Give the start and last cell of the texts.
  2. Type the Number of clusters. It must not be larger than the number of texts.
  3. Optionally, type a Cluster name. The clusters are then stored under this name and can be used later, for example in Properties.
  4. Optionally, open Advanced Options and give a range under Store resulting clusters in cells. It must have the same length as the texts. Each cell then gets the number of the cluster of its text.
  5. Click OK.

The random start of k-means is reset before each run, so the same data give the same clusters. Fuzzy k-means and measures of cluster quality are available as parameters in the CLUSTER category.

Train

Train builds a model that predicts a number from text. An example is predicting a rating scale score from a free-text answer. The model is tested with cross-validation and saved, so you can use it later with Predict.

The fields are:

FieldWhat to enter
Train on text data in start cell/last cellThe range of texts. It can span several neighbouring columns, for example A2;C51 for three text questions.
Word labelOne short label per text column, each confirmed with the space bar. The number of labels should match the number of text columns.
Train to predict numerical values in start cell/last cellThe range of numbers to predict. It must have the same number of rows as the texts. This field is required.
Prediction nameThe name the model is saved under. Do not use the underscore _. The name must be new.
PublicTick this to let all users apply your model. A public model needs a description.
WD PublicMarks the model as public for WordDiagnostics, a related service. Leave it unticked unless you know you need it.
DescriptionWhat the model predicts, the data it was trained on and the model or space it uses.

Always give a prediction name. Without one, the model is saved under a shared default name.

Advanced Options adds these fields for Train:

  • Activate time serie treats the data as a time series. We do not describe this mode further.
  • During cross-validation, group training data based on takes a column of numbers. Rows with the same number are kept together in the same cross-validation group. Use this when one person wrote several texts, so that no person is in both the training and the test part.
  • Store cross-validated predictions in takes an output range of the same length as the texts. Each cell gets the prediction for its text from the model that did not see that text.
  • Numerical data and Numeric labels add numeric predictors next to the text. You can also train on numeric data alone by leaving the text range empty.
  • Covariates takes numeric columns to control for.

How to read the result. The summary lists, among others:

ValueMeaning
modelName, space, algorithmThe name of the model, the space or model used, and the type of regression.
nNumber of data points.
nWordsFound, nWordsWords found in the space, and all words.
rPearson correlation between the cross-validated predictions and the actual values. This is the main measure of how well the model works.
pOne-tailed p-value for r.
rStdStandard error of r.
rOutlinersRemoved, pOutlinersRemovedThe same, after predictions outside the range of the training values are truncated.
ndim, nStddimMean and standard deviation of the number of dimensions used.
cConstant term of the regression.
NremovedNumber of removed or missing data points.
AUCArea under the ROC curve, when the values are split at their mean.
binaryCorrect, binarySensitivity, binarySpecificity, binaryPrecision, binaryRecallClassification measures when values above the mean count as 1 and the rest as 0.
textPredHigh, textDataHighTexts sorted by predicted value, or by actual value.

A model is useful when r is clearly above zero and p is below your alpha level. The value of r estimates how well the model works on new data from the same population.

Plot (word plots and word clouds)

The Plot function draws words, texts or LIWC categories on one, two or three axes. Each axis can be tied to a numeric variable. Words that are significantly related to the variable are shown.

  1. Give the start and last cell of the texts to plot.
  2. Choose the Type of data to plot: Words, Cells (each text is one point) or LIWC.
  3. Choose Cluster Yes or No. Yes groups the plotted items into clusters.
  4. Choose the Type: Word Cloud or Scale.
  5. For the x-axis, give the range of numbers that defines the axis. It must have the same length as the texts. Then choose the semantic scale of the axis. Do the same for the y-axis and the z-axis if you want them.
  6. Click OK. When the cell shows a result, right-click it and choose Show value to see the figure.

The semantic scale of an axis decides the test behind it:

ScaleTest
semanticTestSemantic t-test on each word. A numeric variable is split at its median into two groups.
trainMultiple linear regression against the numeric variable, with cross-validation.
frequencyChi-square test on word frequency.
frequency-correlation or propertyPearson correlation between word frequency and the numeric variable.

Each word gets a z-value and a one-tailed p-value. By default only words with a p-value below 0.05 after Bonferroni correction are plotted. The Bonferroni limit is 0.05 divided by the number of words. The figure note in Show value says how many words were significant with and without correction. Colours, font sizes, the number of words, the correction and the axis labels are set with parameters in the PLOT category. See section 6.

Plot text properties on x, y, z

Click + in the Visualise group to see this function. It places texts in a plot with two axes.

  1. Give the start and last cell of the texts to plot.
  2. Under Texts/prediction/function defining the x-axel, type what defines the x-axis. This can be a text, the name of a prediction, or a function.
  3. Optionally, do the same for the y-axis.

We could not confirm from the code exactly which names this field accepts. Try it on a small example first.

Word clouds and categories of data, Clusters

Click + in the Visualise group to see this function. It makes keyword figures and word clouds.

  1. Give the start and last cell of the texts.
  2. Under Plot values by, choose one of two sources for the axes:
    • Predictions from text data: choose a category and an instance for the x-axis, and optionally for the y-axis.
    • Numerical data from cells: give a range for the x-axis, and optionally for the y-axis. They must have the same length as the texts.
  3. Choose the Type of statistics: Median split count (Chi-2 test), Pearson correlation, or Semantic.
  4. Tick the figures you want: Keywords, Cluster of keywords, Cluster of semantic associates, Cluster of all words, Wordcloud (base word frequency), Wordcloud (high-low), Wordcloud (low-high), Semantic LIWC, Frequency LIWC, Predictions, Variables, Wordclasses, Functions, Clusters, Shared words.
  5. Click OK, then use Show value to see the figures.

Numerical functions

  • SUM(B2;B51), AVG(B2;B51) and STDEV(B2;B51) give the sum, mean and standard deviation of a numeric range. All cells must hold numbers.
  • TTEST(B2;B26;B27;B51;both) compares two numeric ranges with a t-test. The last argument is the tail: both, left or right.
  • corr(B2;B51;C2;C51) gives the correlation between two numeric ranges.

5. Norms, predictions and spaces

Norms

A norm is a short text that stands for a concept. For example, a norm for harmony could be the words harmony, peace, balance, calm. Similarity to a norm then gives each text a score on that concept.

My Norms lists your norms. You can update a description, set public access, and remove a norm. To make a norm:

  1. Open Scales, My Norms, and click Create.
  2. Choose the Language (semantic space).
  3. Type the Name of norm. It must be new.
  4. Type the Text norm, the words or text that define the concept.
  5. Type an Explanatory comment. It is required for a public norm.
  6. Optionally, open Advance Option and fill in Bipolar norm (Subtract text norm). The norm then becomes the difference between the two texts. For example, happy minus sad gives a happy to sad scale.
  7. Optionally, type an email address and tick Make the norm public.

All Norms lists public norms, with the name and email of the person who made each one. Do not give an email address you do not want others to see.

Norms are made in an LSA space of the chosen language. We are not sure how a norm is computed when it is used in a Hugging Face document. Check the results before you rely on them.

Predictions

My Predictions lists the models you made with Train. For each model you can update the description, set Public Access and Public on WordDiagnostics, and remove the model. All Predictions lists the public models of all users.

Spaces

You can make your own LSA space from a text corpus.

  1. Click Create Space on the main page, or open My Spaces and click Create.
  2. Type a Space Name.
  3. Choose a plain text file (.txt) with the corpus. The file name must be new on the server.
  4. Choose the language.
  5. Type a Space description.
  6. Optionally, tick Make the space public.

The space is built on the server, which takes time. The main page shows Recently created space status, where Space Created changes to Yes when it is ready. My Spaces lists your spaces and All Spaces lists public spaces. A ready space appears in the space list when you create a document with LSA models.

The settings for building a space are in the CREATESPACE category of the parameters. They include a context size of 15 words, at most 120,000 words, and 10,000 columns in the co-occurrence matrix. We have not checked whether the web form uses settings other than these defaults.

6. Advanced options

How to set a parameter

  1. In the function dialog, click Advanced Options.
  2. Under Set Parameters here, choose a category. The category of the current function is chosen for you.
  3. Choose a parameter in the next list. Each entry shows its description and its current value.
  4. Type the new value, or choose it from the list that appears.
  5. Click Add Parameter. The parameter is added to the formula. Repeat for more parameters.
  6. Click the X next to a parameter to remove it. Restore Default removes them all.

A parameter changes only the formula it is added to. For an option with two states, 1 means on and 0 means off.

Parameters you are most likely to change

CategoryParameterWhat it doesValues
BERTBERTnameThe Hugging Face model, written exactly as on huggingface.co. It overrides BERT. A Hugging Face document sets this for you.A model name, such as sentence-transformers/all-mpnet-base-v2
BERTUses a model instead of LSA.LSA, bert-base-multilingual-cased, bert-base-uncased, roberta-base, xlm-roberta-base
CONTEXT GENERATIONSnormalizeSpaceNormalises each text vector to length 1.1 (default), 0
xmeanCorrectionCorrects for frequency artefacts when a text vector is made.0, 1
forceMaxDimLargest number of dimensions used. 0 means all.A whole number
trainReplaceMissingDataWithMeanReplaces missing numeric values with the mean of the variable.0 (default), 1
GETPROPERTYgetPropertyShowWhat a similarity or property returns. The same as Measure semantic distance by.See Semantic similarity
correlationTypeType of correlation.Pearson (default), Kendall, Spearman
mapPredictions2LabelsMaps predictions to the labels Normal, Mild, Moderate and Severe.0 (default), 1
SEMANTIC TESTpaired_semantic_differenceRuns a paired semantic t-test.0, 1
match_paired_test_on_subject_propertyMatches the pairs on a stored subject property instead of row order.0, 1
semanticTestMatchPropertyThe property to match pairs on.A property name
KEYWORDSkeywordCorrectionTypeCorrection for multiple comparisons in the keyword test.0 Bonferroni (default), 1 Holm, 2 none
keywordsPointBiSerialCorrelationUses point-biserial correlation.0 (default), 1
CLUSTERclusterFuzzyKMeansUses fuzzy k-means.0 (default), 1
clusterQualityComputes the Davies-Bouldin and Dunn indices for 1 to N clusters. This is slow.0 (default), 1
clusterNRepetionsRepeats k-means N times and keeps the best result by Dunn's index.A whole number, default 1
TRAINNleaveOutsNumber of groups in the cross-validation.A whole number, such as 10
modelType of regression.regression (default), logistic, ridge, lasso
selectBestDimensionsOrders dimensions by how well they correlate with the outcome.noSelection (default), stepwise, simple, after
trainRemoveOutLinersRemoves outliers in the training data and the predictions.0 (default), 1
zTransformGroupZ-transforms the values within each group.0 (default), 1
trainOutPutCrossValidatedDataPrints the cross-validated predictions in the result.0 (default), 1
trainMengzTests with Meng's test whether the prediction correlates more with the outcome than another variable does.A variable name
trainBinaryOptimizeMethodHow the threshold is chosen for the binary measures.recall&precision (default), recall, FA, Hits
randomizeTrainingShuffles the training data. The result should then not be significant. Use it as a check.0 (default), 1
PLOTplotBonferroniCorrection for multiple comparisons in word plots.1 Bonferroni (default), 2 Holm, 0 none
keywordsPlotPvaluePlots words with p-values below this limit.A number between 0 and 1, such as 0.05
plotWordcountMaxNumberLargest number of words in a word cloud.A whole number
plotAxisWhat the axes show.default, z, q, f, 1-p, predicted
plotSignificantColorsColour scheme.1 red, 2 by p-value (default), 3 grouped, 4 random, 5 one random colour, 6 colour map, 7 z-values, 8 cluster
plotColorMapColour map used by scheme 6.hot (default), parula, jet, hsv, cool, spring, summer, autumn, winter, gray
plotRemoveWordsWords to leave out of the plot.Words separated by spaces
plotReplaceWordsReplaces words in the plot.Pairs separated by commas, such as U.S. USA, you YOU
plotRemoveHFWordsRemoves high-frequency words.0 keeps all, try 0.001
plotTitle, plotXlabel, plotYlabel, plotZlabelTitle and axis labels.Text
fontsizeLimitsSmallest and largest font size.Two numbers
plotNominalTreats the data as categories or as continuous.non-nominal (default), nominal
TRANSLATEtranslateTranslates the words in plots into English.0 (default), 1
translateTolanguageLanguage to translate into.A language code, such as en
ASSOCIATESnumber_of_ass2Number of semantic associates to print.A whole number

The dialog lists many more parameters. Most of them are for special analyses. Change them only if you know what they do. Some parameters are blocked on the web server for safety.

7. How the statistics are computed and how to report them

Text vectors

  • LSA. The vector of a text is the sum of the vectors of its words. The sum is then normalised to length 1. Words that are not in the space are left out.
  • Hugging Face. The vector of a text is the mean of the last hidden layer of the model over all tokens of the text.

Semantic similarity

Similarity is the cosine of the angle between two text vectors.

Semantic t-test

Independent sets. The vectors of each set are summed. The sum of one set is subtracted from the sum of the other. This gives a difference vector, which is a semantic scale between the two sets. Each text is then given a score, its similarity to the difference vector. To avoid bias, the difference vector is made with 10% of the texts left out, and the left-out texts are scored. This is repeated until all texts have a score. The scores of the two sets are compared with a one-tailed t-test.

Paired sets. For each pair, the vector of the second text is subtracted from the vector of the first. Each pair's difference is compared with the mean difference of all other pairs. The resulting scores are tested against zero with a one-tailed one-sample t-test.

Train

Train uses multiple linear regression. The predictors are the first d dimensions of the text vectors. The number d is chosen by leave-one-out cross-validation. The performance of the model is then measured with leave-10%-out cross-validation. The cross-validated predictions are correlated with the actual values. The p-value of this correlation is one-tailed, because only a positive correlation shows that the model works.

Word plots and keywords

Each word gets a z-value. The z-value is turned into a one-tailed p-value. With Bonferroni correction, a word is significant when its p-value is below 0.05 divided by the number of words.

How to report results

Give enough detail for another person to repeat the analysis. State:

  • That you used SemanticExcel, and the date of the analysis.
  • The model or space. For Hugging Face, give the exact model name, such as sentence-transformers/paraphrase-multilingual-mpnet-base-v2. For LSA, give the language and the space name shown next to the document name.
  • Every parameter you changed from its default, with its value.
  • For the semantic t-test: independent or paired, the number of texts in each set, the t-value, the one-tailed p-value and Cohen's d.
  • For Train: the number of data points, the number of cross-validation groups, the regression type, the correlation r between predicted and actual values, and the one-tailed p-value.
  • For word plots and keyword tests: the correction for multiple comparisons and the alpha level.
  • That the tests are one-tailed.

An example: "We trained a model in SemanticExcel to predict SWLS scores from the harmony texts, using the Hugging Face model sentence-transformers/paraphrase-multilingual-mpnet-base-v2 and multiple linear regression with 10-fold cross-validation. The predicted and actual scores correlated r = .45, p < .001 (one-tailed), N = 300." The numbers in this example are made up.

The figure note under Show value describes the method behind a word plot in words. You can use it as a starting point for the method section.

8. The API

The API lets a program send texts to SemanticExcel and get properties back. It is meant for users who can program. The API page in the menu bar describes it. You need an API key pair. Use the contact form to ask for one.

Each request must carry two HTTP headers, public and hash, with your public key and your key value. Results come back in JSON.

setProperty

Stores texts on the server under names you choose. The parameters are:

  • documentSpace: a name for your store, such as myTest.
  • language: a language code, such as en or sv.
  • data[]: the texts, one per entry.
  • identifier[]: a name for each text, such as _text1.
  • datalabel[]: optional numbers for each text, such as _number1.

A reply looks like {"status":"ok","data":"{\"refkey\":\"...\",\"answer\":\"saved successfully\"}"}.

getProperty

Computes a property of stored texts or of texts you send. The parameters are:

  • language: a language code.
  • property: the property, such as frequency or the name of a prediction. Do not add _ in front.
  • identifierOrText[]: names of stored texts with a leading _, together with documentSpace. Or the texts themselves.
  • parameterType[] and parameterValue[]: optional parameters from section 6, in matching pairs.
  • refkey: a reference key for the request. The server requires it, although the API page does not list it.

A reply looks like {"status":"ok","data":{"refkey":"...","answer":" 0.17998 "}}.

9. Troubleshooting and good practice

Common problems

ProblemWhat to do
The cell shows Calculating... for a long time.Large data sets take time. The first use of a Hugging Face model also includes a download, which can take several minutes. Keep the page open.
The cell shows Error during calculating.Check that the ranges are correct and in one column, that ranges that belong together have the same length, and that numeric ranges hold only numbers. Check that the model name is correct. Then try a small part of the data.
The result is empty or very low for some texts.With LSA, words that are not in the space are ignored. A text in another language than the space, or a text with only rare words, gets an empty or weak vector. Use the property nwordsfound to count the words found. Empty cells give empty results.
A Hugging Face model fails.The model must exist on huggingface.co under exactly that name. It must have safetensors weights and must not need its own code. Try a model from the recommended list.
Long texts.A Hugging Face model reads only up to its maximum length, often 512 tokens. The rest of a longer text is cut off without a warning. Split long texts into parts if the end matters.
The import gives no document.Ordinary accounts can import files up to 1 MB. Use .csv, .xlsx or .xls. Only the first sheet is read.
Part of the data is missing after import.Your cell limit cuts off rows and columns. Use Apply for more cells.
The dialog does not open.Select a cell before you open Functions.

Good practice

  • Match the language. The language of the space or model must match the language of the texts. For several languages, use a multilingual Hugging Face model.
  • Keep the model the same. Compare and combine only results made with the same model or space. Apply a saved prediction only to documents with the same model or space it was trained with.
  • Plan the tests before you run them. Decide which tests and corrections you will use before you look at the results.
  • Check on a small example. Before a large analysis, run the function on a few rows and read the result with Show value.
  • Write down the settings. Note the model, the parameters and the date for your report.
  • Protect privacy. Your texts are sent to and stored on the SemanticExcel server. Do not upload names, personal identity numbers, addresses or other data that can identify a person. Remove or replace such details before you upload. Follow the rules of your ethics approval.
  • Mind what you make public. Public predictions, norms and spaces can be seen and used by all users. All Norms shows the email address you give with a norm.
  • Treat the results as research results. SemanticExcel is a research tool. Its scores are not validated for diagnosis or for decisions about individual people.

Get help

Use the contact form on the login page. Click Send a message under Contact us. Choose a topic: Report an error, Interested in developing the software, Add a related publication, Sign up for a workshop, or Other. Then give your name, your email address and your message. When you report an error, say which document, which function and what the cell showed.

10. Further reading

These publications describe the methods behind SemanticExcel and show how to use them:

The Publications page in the menu bar lists more studies that used SemanticExcel.

11. The library of semantic measures

The Library is an open collection of semantic measures: norms and trained models that others can find, use, cite and share. Anyone can browse it without logging in.

Levels

  • 1 Shared. The measure is public and has a name and a language.
  • 2 Documented. The datasheet is complete: authors, language, model or space, what it measures, the intended population, how it was made, the validation and the license.
  • 3 Validated. An editor has reviewed this version and its validation evidence. A new version needs a new review.

Publish a measure

  1. Open My Norms or My Predictions.
  2. Click Library next to the norm or the trained model.
  3. Fill in the datasheet. Only the name and the language are needed to publish, but a complete datasheet gives level 2.
  4. To ask for level 3, tick the box that asks an editor to review the version.

Publishing makes the measure and its datasheet public. Do not write personal data about participants in it. For a trained model, the training results stored with the model are added to the datasheet.

Versions and citation

A published version never changes. When you edit the datasheet, a new version is added, and the old one stays, so a citation of it still works. Each measure page shows a citation with the version number. Cite the version you used, and the DOI when the measure has one.

If you withdraw a measure, it is no longer listed, but its page stays so that citations still work.

Use a measure from the library

  • A norm is defined by its words. Choose it under Semantic similarity. Its vector is computed in the model or space of your document, so you can use it with another model than it was made with. Report the model you used.
  • A trained model works only in the model or space it was trained in. Choose it under Predict in a document that uses that model or space.
  • The Download button gives the datasheet and the definition as a JSON file, so the measure can be used in other tools.