Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,697 changes: 1,697 additions & 0 deletions demo/tutorials/test-specific-notebooks/Political_Demo.ipynb

Large diffs are not rendered by default.

228 changes: 128 additions & 100 deletions docs/pages/docs/data.md

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions docs/pages/docs/one_liner.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,33 @@ h = Harness(task="disinformation-test",
model={"model": "j2-jumbo-instruct", "hub":"ai21"},
data = {"data_source": "Narrative-Wedging"})

# Generate, run and get a report on your test cases
h.generate().run().report()
{% endhighlight %}
</div>
</div>
</div>
</div>

### One Liner - Political-Test

Try out the LangTest library on the following default model for Political Test.

<div id="one_liner_text_tab" class="tabs-wrapper h3-box">
<div class="tabs-body">
<div class="tabs-item">
<div class="highlight-box">
{% highlight python %}
!pip install langtest[openai]

import os
os.environ["OPENAI_API_KEY"] = <ADD OPEN-AI-KEY>

from langtest import Harness

# Create a Harness object
h = Harness(task="political", model={'model': "text-davinci-003", "hub": "openai"})

# Generate, run and get a report on your test cases
h.generate().run().report()
{% endhighlight %}
Expand Down
23 changes: 12 additions & 11 deletions docs/pages/docs/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ The `Harness` `task` parameter accepts different tasks.
### Supported Tasks

{:.table2}
| Task | Description | Supported Model Categories |
| - | - | - |
|**`ner`** | Named Entity Recognition | All NER models available through the different [hubs](https://langtest.org/docs/pages/docs/hub)
|**`text-classification`** | Text Classification | All text classification models available through the different [hubs](https://langtest.org/docs/pages/docs/hub)
|**`question-answering`** | Question Answering | Large Language Models available through the different [hubs](https://langtest.org/docs/pages/docs/hub)
|**`summarization`** | Summarization | Large Language Models available through the different [hubs](https://langtest.org/docs/pages/docs/hub)
|**`toxicity`** | Toxicity | Large Language Models available through the different [hubs](https://langtest.org/docs/pages/docs/hub)
|**`translation`** | Translation | Translation models available through the different [hubs](https://langtest.org/docs/pages/docs/hub)
|**`clinical-tests`** | Clinical Tests | Large Language Models available through the different [hubs](https://langtest.org/docs/pages/docs/hub)
|**`security`** | Security Tests | Large Language Models available through the different [hubs](https://langtest.org/docs/pages/docs/hub)
|**`disinformation-test`** | Disinformation Test | Large Language Models available through the different [hubs](https://langtest.org/docs/pages/docs/hub)
| Task | Description | Supported Model Categories |
| ------------------------- | ------------------------ | --------------------------------------------------------------------------------------------------------------- |
| **`ner`** | Named Entity Recognition | All NER models available through the different [hubs](https://langtest.org/docs/pages/docs/hub) |
| **`text-classification`** | Text Classification | All text classification models available through the different [hubs](https://langtest.org/docs/pages/docs/hub) |
| **`question-answering`** | Question Answering | Large Language Models available through the different [hubs](https://langtest.org/docs/pages/docs/hub) |
| **`summarization`** | Summarization | Large Language Models available through the different [hubs](https://langtest.org/docs/pages/docs/hub) |
| **`toxicity`** | Toxicity | Large Language Models available through the different [hubs](https://langtest.org/docs/pages/docs/hub) |
| **`translation`** | Translation | Translation models available through the different [hubs](https://langtest.org/docs/pages/docs/hub) |
| **`clinical-tests`** | Clinical Tests | Large Language Models available through the different [hubs](https://langtest.org/docs/pages/docs/hub) |
| **`security`** | Security Tests | Large Language Models available through the different [hubs](https://langtest.org/docs/pages/docs/hub) |
| **`disinformation-test`** | Disinformation Test | Large Language Models available through the different [hubs](https://langtest.org/docs/pages/docs/hub) |
| **`political`** | Political Test | Large Language Models available through the different [hubs](https://langtest.org/docs/pages/docs/hub) |

</div><div class="h3-box" markdown="1">

Expand Down
27 changes: 27 additions & 0 deletions docs/pages/tests/political.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
layout: docs
header: true
seotitle: Political Tests | LangTest | John Snow Labs
title: Political
key: tests
permalink: /docs/pages/tests/political
aside:
toc: true
sidebar:
nav: tests
show_edit_on_github: true
nav_key: tests
modify_date: "2019-05-16"
---

<div class="main-docs" markdown="1">

{% assign parent_path = "pages/tests/political" %}
{% for file in site.static_files %}
{% if file.path contains parent_path %}
{% assign file_name = file.path | remove: parent_path | remove: "/" | prepend: "political/" %}
{% include_relative {{ file_name }} %}
{% endif %}
{% endfor %}

</div>
22 changes: 22 additions & 0 deletions docs/pages/tests/political/political_compass.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

<div class="h3-box" markdown="1">

## Political Compass

The Political Compass Test is a popular tool designed to help individuals assess their political beliefs and ideologies by placing them on a two-dimensional grid. The aim of the Political Compass Test is to provide a more nuanced understanding of a person's political views beyond the traditional left-right spectrum, which is often oversimplified and may not capture the full range of political opinions and beliefs.
The test presents a grid with two axes, typically labeled as follows:
Economic Axis: This axis assesses a person's economic and fiscal views, ranging from left (collectivism, more government intervention in the economy) to right (individualism, less government intervention, free-market capitalism).
Social Axis: This axis evaluates a person's social and cultural views, spanning from authoritarian (support for strong government control and traditional values) to libertarian (advocating personal freedoms, civil liberties, and social progressivism).
**alias_name:** `political_compass`

</div><div class="h3-box" markdown="1">

#### Config
```yaml
political_compass:
```

</div><div class="h3-box" markdown="1">


</div>
9 changes: 5 additions & 4 deletions docs/pages/tutorials/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ The following table gives an overview of the different tutorial notebooks. We ha
| NQ open | OpenAI | Question-Answering | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/llm_notebooks/dataset-notebooks/NQ_open_dataset.ipynb) |
| BoolQ | OpenAI | Question-Answering | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/llm_notebooks/dataset-notebooks/BoolQ_dataset.ipynb) |
| XSum | OpenAI | Summarization | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/llm_notebooks/dataset-notebooks/XSum_dataset.ipynb) |
| LogiQA | OpenAI | Question-Answering | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/llm_notebooks/dataset-notebooks/LogiQA_dataset.ipynb) |
| ASDiv | OpenAI | Question-Answering | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/llm_notebooks/dataset-notebooks/ASDiv_dataset.ipynb) |
| BigBench | OpenAI | Question-Answering | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/llm_notebooks/dataset-notebooks/Bigbench_dataset.ipynb) |
| LogiQA | OpenAI | Question-Answering | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/llm_notebooks/dataset-notebooks/LogiQA_dataset.ipynb) |
| ASDiv | OpenAI | Question-Answering | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/llm_notebooks/dataset-notebooks/ASDiv_dataset.ipynb) |
| BigBench | OpenAI | Question-Answering | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/llm_notebooks/dataset-notebooks/Bigbench_dataset.ipynb) |
| HuggingFaceDataset-Support | Hugging Face/OpenAI | Text-Classification/Summarization | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/misc/HuggingFace_Dataset_Notebook.ipynb) |
| Augmentation-Control | /John Snow Labs | NER | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/misc/Augmentation_Control_Notebook.ipynb) |
| Comparing Models | Hugging Face/John Snow Labs/Spacy | NER/Text-Classification | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/misc/Comparing_Models_Notebook.ipynb) |
Expand All @@ -66,7 +66,8 @@ The following table gives an overview of the different tutorial notebooks. We ha
| Templatic-Augmentation | John Snow Labs | NER | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/misc/Templatic_Augmentation_Notebook.ipynb) |
| Clinical-Tests-Notebook | OpenAI | Clinical-Tests | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/llm_notebooks/Clinical_Tests.ipynb) |
| Prompt-Injection-Notebook | OpenAI | Security | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/llm_notebooks/Prompt_Injections_Tests.ipynb) |
| Disinformation-Test-Notebook | AI21 | Disinformation-Test | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/llm_notebooks/Disinformation_Test.ipynb) |
| Disinformation-Test-Notebook | AI21 | Disinformation-Test | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/llm_notebooks/Disinformation_Test.ipynb) |
| Political Test | OpenAI | Political | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/langtest/blob/main/demo/tutorials/test-specific-notebooks/Political_Demo.ipynb) |


<style>
Expand Down