RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

LicensePrivacy
/
See all docs
Builtin Reference
    • addDependencyDetails
    • addEntityDetails
    • addLemmaDetails
    • addPartOfSpeechDetails
    • addSentenceDetails
    • addTypeDetails
    • bagOfNgrams
    • bagOfWords
    • cosineSimilarity
    • doc2sequence
    • encode
    • extractFileText
    • extractHTMLText
    • fastTextWordEmbedding
    • findElement
    • getAttribute
    • htmlTree
    • ind2word
    • isVocabularyWord
    • normalizeWords
    • readWordEmbedding
    • removeLongWords
    • removeShortWords
    • removeStopWords
    • removeWords
    • stopWords
    • tokenDetails
    • tokenizedDocument
    • trainWordEmbedding
    • vaderSentimentScores
    • vec2word
    • word2ind
    • word2vec
    • wordEncoding
    • writeWordEmbedding

tokenDetails — Return a table of token details for tokenized documents.

tokenDetails(documents) returns a table describing the tokens stored in a tokenizedDocument object.

Syntax

tdetails = tokenDetails(documents)

Inputs

NameTypeRequiredDefaultDescription
documentsAnyYes—tokenizedDocument object.

Returns

NameTypeDescription
tdetailsAnyToken detail table.

Errors

IdentifierWhenMessage
RunMat:tokenDetails:InvalidInputInput is not a supported tokenizedDocument object or option form.tokenDetails: invalid input

How tokenDetails works

  • documents must be a tokenizedDocument object created by tokenizedDocument.
  • Normally tokenized documents return table variables Token, DocumentNumber, LineNumber, Type, and Language.
  • After addSentenceDetails, documents also return a SentenceNumber variable after DocumentNumber.
  • After addPartOfSpeechDetails, documents also return a PartOfSpeech variable after Language.
  • After addEntityDetails, documents also return an Entity variable after PartOfSpeech when part-of-speech details are present, otherwise after Language.
  • After addLemmaDetails, documents also return a Lemma variable after Language; if multiple language details are present, PartOfSpeech precedes Entity, and Entity precedes Lemma.
  • After addDependencyDetails, documents also return Head and Dependency variables after the other language-detail variables.
  • Pre-tokenized documents created with TokenizeMethod, "none" initially return only Token and DocumentNumber, matching MATLAB's manually tokenized form.
  • After addTypeDetails, pre-tokenized documents also return a Type variable.
  • Type values are derived from RunMat's lightweight tokenizer and include letters, digits, punctuation, email-address, web-address, hashtag, at-mention, emoticon, emoji, and other.
  • LineNumber is currently 1 for each token because RunMat's tokenizer stores document-level tokens and does not yet preserve per-line token provenance.
  • Dependency, entity, and language annotations use the models available in the current Text Analytics implementation; their results can differ from other language-model implementations.
  • DocumentNumber, SentenceNumber, LineNumber, and Head are generated double table columns. tokenDetails has no caller-provided native integer input.

GPU memory and residency

tokenDetails constructs a host table and has no provider kernel.

Examples

View Token Details

documents = tokenizedDocument(["alpha 123"; "visit https://example.com"]);
tdetails = tokenDetails(documents)

Expected output:

`tdetails` is a table with token text, document number, line number, token type, and language.

Add Types To Pre-Tokenized Documents

documents = tokenizedDocument(["For" "more" "information"], "TokenizeMethod", "none");
documents = addTypeDetails(documents);
tdetails = tokenDetails(documents)

Expected output:

`tdetails` includes `Token`, `DocumentNumber`, and `Type`.

Add Sentence Numbers

documents = tokenizedDocument("First sentence. Second sentence.");
documents = addSentenceDetails(documents);
tdetails = tokenDetails(documents)

Expected output:

`tdetails` includes `SentenceNumber`.

Add Lemmas

documents = tokenizedDocument("The dogs ran.");
documents = addLemmaDetails(documents);
tdetails = tokenDetails(documents)

Expected output:

`tdetails` includes `Lemma`.

Add Part-Of-Speech Tags

documents = tokenizedDocument("The dogs are running.");
documents = addPartOfSpeechDetails(documents);
tdetails = tokenDetails(documents)

Expected output:

`tdetails` includes `PartOfSpeech`.

Add Entity Tags

documents = tokenizedDocument("Mary uses MATLAB at MathWorks.");
documents = addEntityDetails(documents);
tdetails = tokenDetails(documents)

Expected output:

`tdetails` includes `Entity`.

Add Dependency Details

documents = tokenizedDocument("The dogs chase cats.");
documents = addDependencyDetails(documents);
tdetails = tokenDetails(documents)

Expected output:

`tdetails` includes `Head` and `Dependency`.

Using tokenDetails with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how tokenDetails changes the result.

Run a small tokenDetails example, explain the result, then change one input and compare the output.

FAQ

Does tokenDetails return sentence or part-of-speech details?⌄

It returns SentenceNumber after addSentenceDetails, PartOfSpeech after addPartOfSpeechDetails, Entity after addEntityDetails, Lemma after addLemmaDetails, and Head/Dependency after addDependencyDetails.

Does tokenDetails execute on the GPU?⌄

No. It builds a host table from token metadata.

Related Strings functions

Text Analytics

addDependencyDetails · addEntityDetails · addLemmaDetails · addPartOfSpeechDetails · addSentenceDetails · addTypeDetails · bagOfNgrams · bagOfWords · cosineSimilarity · doc2sequence · encode · extractFileText · extractHTMLText · fastTextWordEmbedding · findElement · getAttribute · htmlTree · ind2word · isVocabularyWord · normalizeWords · readWordEmbedding · removeLongWords · removeShortWords · removeStopWords · removeWords · stopWords · tokenizedDocument · trainWordEmbedding · vaderSentimentScores · vec2word · word2ind · word2vec · wordEncoding · writeWordEmbedding

Transform

append · deblank · erase · eraseBetween · erasePunctuation · eraseURLs · extractAfter · extractBefore · extractBetween · insertAfter · insertBefore · join · lower · pad · replace · replaceBetween · reverse · split · splitlines · strcat · strip · strjoin · strjust · strrep · strsplit · strtrim · upper

Core

blanks · char · compose · convertCharsToStrings · convertContainedStringsToChars · convertStringsToChars · genvarname · int2str · isletter · isspace · isStringScalar · isstrprop · mat2str · native2unicode · newline · num2str · sprintf · sscanf · str2double · str2num · strcmp · strcmpi · string · string.empty · strings · strlength · strncmp · strncmpi · strtok · unicode2native

Search

contains · endsWith · matches · startsWith · strfind

Pattern

digitsPattern · lettersPattern · pattern · regexpPattern · textBoundary · wildcardPattern

Regex

regexp · regexpi · regexprep

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how tokenDetails is executed, line by line, in Rust.

  • View the source for tokenDetails in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • How tokenDetails works
  • GPU memory and residency
  • Examples
  • View Token Details
  • Add Types To Pre-Tokenized Documents
  • Add Sentence Numbers
  • Add Lemmas
  • Add Part-Of-Speech Tags
  • Add Entity Tags
  • Add Dependency Details
  • Using tokenDetails with coding agents
  • FAQ
  • Related Strings functions
  • Text Analytics
  • Transform
  • Core
  • Search
  • Pattern
  • Regex
  • Open-source implementation
  • About RunMat