ThemeTableJSON

Tabulates in JSON themes found in text

CategoriesResourceCreateNotebook

Prompt DefinitionResourceCreateNotebook

Prompt TextResourceCreateNotebook

Split the following (NotebookTemplateSlot[, "text", Positional, ]) into thematic parts:
 (NotebookTemplateSlot[, "", Positional, ])
 
 Return the parts as a JSON array. 
 Represent each thematic part with a theme-content pair.
 Make sure each of the content descriptions has no more than (NotebookTemplateSlot[, 100, Positional, ]) words.

Chat-Related Features (optional)

Persona Icon

Cell Processing Function

Automatic

Cell Post Evaluation Function

Automatic

Programmatic Features (optional)

Output InterpreterResourceCreateNotebook

Interpreter["String"]

Documentation

UsageResourceCreateNotebook

Details & OptionsResourceCreateNotebook

The default value of the second, text type argument is "text".

The defult value of the third argument -- number of words per theme content description -- is 100.

Since many LLMs return JSON code within Markdown code markings the interpreter of this LLM function is "String".

That allows to get results which are almost valid JSON codes.

LLM Configuration (optional)

LLM Tools

LLMTool["…"]

LLM Configuration Options

<||>

Chat Examples

The text in the chat cell is taken from the section "History" of the Wikipedia article "Pythagoreanism".

Programmatic ExamplesResourceCreateNotebook

Here we tabulate UN Human Rights document:

tblHR=LLMResourceFunction["ThemeTableJSON"][ExampleData[{"Text","UNHumanRightsEnglish"}]]

Here we use the second argument to specify that the text is a theatrical play and the content descriptions are no more than 20 words:

tblHamlet=LLMResourceFunction["ThemeTableJSON"][ExampleData[{"Text","Hamlet"}],"theatrical play",20]

Scope

The following function converts wider range of LLM results obtained by requests to generate JSON code:

Clear[FromJSON];
FromJSON[t_String]:=ImportString[FromCharacterCode@ToCharacterCode[StringReplace[t,{StartOfString~~"```json","```"~~EndOfString}->""],"UTF-8"],"RawJSON"];

Here we convert the LLM Human Rights result into a table:

ResourceFunction["GridTableForm"]@Dataset[tblHR//FromJSON]

Here we convert the "Hamlet" LLM result into a table:

ResourceFunction["GridTableForm"]@Dataset[tblHamlet//FromJSON]

Applications

Properties and Relations

Possible Issues

For most articles only models with larger limits of input tokens can applied. For example, (current) OpenAI's ChatGPT model "gpt-4-turbo-preview" that allows 128K input tokens.

Neat Examples

Source & Additional Information

Contributed By

Anton Antonov

KeywordsResourceCreateNotebook

Theme

Topics

JSON

Table

TopicsResourceCreateNotebook

Related Documentation PagesResourceCreateNotebook

Symbol name or documentation URI

Related Resource ObjectsResourceCreateNotebook

Resource Name (resources from any Wolfram repository)

Original Source References and AttributionsResourceCreateNotebook

Source, reference or citation

LinksResourceCreateNotebook

Link to other related material

CompatibilityResourceCreateNotebook

Wolfram Language VersionResourceCreateNotebook

13.3+

Operating SystemResourceCreateNotebook

EnvironmentsResourceCreateNotebook

Cloud SupportResourceCreateNotebook

Required FeaturesResourceCreateNotebook

Author NotesResourceCreateNotebook

Additional information about limitations, issues, etc.

Submission NotesResourceCreateNotebook

Additional information for the reviewer.