Here we tabulate UN Human Rights document:
In[40]:=
tblHR=LLMResourceFunction["ThemeTableJSON"][ExampleData[{"Text","UNHumanRightsEnglish"}]]
Out[40]=
```json[ { "theme": "Preamble", "content": "The preamble highlights the importance of human dignity, equality, and the inalienable rights of all individuals as the foundation of freedom, justice, and peace. It emphasizes the consequences of disregarding human rights and the necessity of protecting these rights by the rule of law to prevent tyranny and oppression. It also mentions the commitment of United Nations members to promote human rights and the importance of a common understanding of these rights for their full realization." }, { "theme": "General Principles", "content": "Articles 1 to 2 establish the general principles of the Declaration, affirming that all human beings are born free and equal in dignity and rights, endowed with reason and conscience, and should act towards one another in a spirit of brotherhood. Everyone is entitled to the rights and freedoms set forth in the Declaration without discrimination of any kind." }, { "theme": "Personal Rights and Freedoms", "content": "Articles 3 to 5 outline fundamental personal rights and freedoms, including the right to life, liberty, and security of person; the prohibition of slavery and servitude; and the prohibition of torture or cruel, inhuman, or degrading treatment or punishment." }, { "theme": "Legal Rights and Equality", "content": "Articles 6 to 11 focus on legal rights and equality before the law, including the right to recognition as a person before the law, equal protection of the law without discrimination, and the rights related to justice, such as a fair trial and the presumption of innocence." }, { "theme": "Privacy, Movement, and Asylum", "content": "Articles 12 to 14 protect the rights to privacy, freedom of movement and residence, and the right to seek asylum from persecution in other countries, emphasizing the importance of these freedoms for individual dignity and personal development." }, { "theme": "Nationality and Family Rights", "content": "Articles 15 to 17 address the rights related to nationality, marriage, and family, and property ownership. These include the right to a nationality, the right to marry and found a family with equal rights, and the right to own property." }, { "theme": "Thought, Expression, Assembly, and Association", "content": "Articles 18 to 20 cover freedoms related to thought, conscience, religion, opinion, expression, peaceful assembly, and association, highlighting the importance of these freedoms for the expression of individuality and participation in society." }, { "theme": "Participation in Government and Social Security", "content": "Articles 21 to 22 discuss the right to participate in government, access public service, and the right to social security, emphasizing the role of democratic participation and social security in ensuring dignity and free development of personality." }, { "theme": "Economic, Social, and Cultural Rights", "content": "Articles 23 to 27 outline economic, social, and cultural rights, including the right to work, rest and leisure, an adequate standard of living, education, and participation in cultural life, as well as the rights related to the benefits of scientific advancement." }, { "theme": "Duties to the Community and Limitations on Rights", "content": "Article 29 addresses the duties to the community and the limitations on the exercise of rights and freedoms, stating that everyone has duties to the community and that the exercise of rights and freedoms may be limited by law for the purpose of securing respect for the rights and freedoms of others and meeting the requirements of morality, public order, and general welfare." }, { "theme": "Prohibition of Rights and Freedoms Destruction", "content": "Article 30 clarifies that nothing in the Declaration may be interpreted as implying for any State, group, or person any right to engage in activities or perform acts aimed at the destruction of the rights and freedoms set forth in the Declaration, safeguarding the integrity of the rights and freedoms against abuse." }]```
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:
In[38]:=
tblHamlet=LLMResourceFunction["ThemeTableJSON"][ExampleData[{"Text","Hamlet"}],"theatrical play",20]
Out[38]=
```json[ { "theme": "Introduction and Ghost's Appearance", "content": "The ghost of King Hamlet appears, urging Prince Hamlet to avenge his murder by killing the new king, Claudius." }, { "theme": "Hamlet's Madness", "content": "Hamlet feigns madness to investigate his father's murder and contemplates life, death, and the nature of reality." }, { "theme": "The Play Within a Play", "content": "Hamlet stages a play reenacting his father's murder to gauge King Claudius's guilt through his reaction." }, { "theme": "Ophelia's Descent into Madness", "content": "Affected by her father Polonius's death and Hamlet's rejection, Ophelia descends into madness and eventually drowns." }, { "theme": "The Closet Scene", "content": "Hamlet confronts his mother about her involvement in his father's murder, accidentally killing Polonius in the process." }, { "theme": "Laertes' Revenge", "content": "Laertes returns to avenge Polonius's death, leading to a duel with Hamlet that ends tragically for all involved." }, { "theme": "The Climactic Duel", "content": "The duel between Hamlet and Laertes, laced with treachery, results in the deaths of Claudius, Gertrude, Laertes, and Hamlet." }, { "theme": "The Tragic Resolution", "content": "Fortinbras arrives to find the Danish royal family dead, and Hamlet's last wish is for Fortinbras to become king." }]```
Scope (3)
Scope
(3)
The following function converts wider range of LLM results obtained by requests to generate JSON code:
In[28]:=
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:
Here we convert the "Hamlet" LLM result into a table:
Possible Issues
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.