> For the complete documentation index, see [llms.txt](https://docs.lassomoderation.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lassomoderation.com/automation-and-review/research.md).

# Research

Test rule conditions against your recent content to see what a rule would match, without taking any action.

Research lets you try out rule conditions on content you have already received. You build a set of conditions, Lasso checks them against a sample of your recent content, and you see how many items match and which ones. This is called a backtest. For example, you can check how many images an explicit nudity score above 80% would catch before you build a rule around it, or look for a spam phrase across your last 10,000 items.

{% hint style="info" %}
Research is available to Admins. See [Who can use Research](#who-can-use-research) to open it to other roles.
{% endhint %}

{% embed url="<https://vimeo.com/1243273315>" %}
A short demo of building conditions, running a backtest and reading the results
{% endembed %}

A backtest takes no moderation action. It does not change the status of any content or user, and it does not send webhooks, create reviews or count as a rule match.

### What you can use it for

* **Tune a threshold**: compare how many items match at different AI score thresholds before you put one in a rule.
* **Investigate a pattern**: find recent content that contains certain words or comes from a certain kind of user.
* **Check an existing rule**: open a rule in Research, change its conditions and see how the results differ, without touching the rule.
* **Start a new rule**: when the results look right, turn your conditions into a rule.

### Running a backtest

1. Go to **Research** in the **Oversight** section of the navigation.
2. Under **Conditions**, click **Add condition** and pick a condition. Conditions work the same as in [custom moderation rules](https://docs.lassomoderation.com/automation-and-review/custom-moderation-rules.md), including combining them with **AND** and **OR** and using **Add group**.
3. Under **Sample**, choose how many content items to check: **1,000**, **2,500**, **5,000** or **10,000**.
4. Choose where the sample comes from:
   * **Most recent**: your newest content, going back from now.
   * **Last 7 days** or **Last 30 days**: content spread over that period. Busier hours get a bigger share of the sample, in line with how much content you received in them.
5. Click **Run backtest**.

With a lot of traffic, **Most recent** can cover only the last few hours. Pick **Last 7 days** or **Last 30 days** when you want the sample to include different times of day and days of the week, for example to see how a condition does on weekends.

Results appear while the backtest runs, and you can click **Stop** at any time. A stopped backtest keeps the results it found so far, but cannot be resumed.

<figure><img src="https://2736176226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFslADZ1R9paAfD3FHscR%2Fuploads%2Fgit-blob-75ab990917321a6f50b44af2f4ec69d528572a6a%2Fresearch-backtest-results.png?alt=media" alt="The Research page with an image label condition on the left and the results of a finished backtest on the right"><figcaption></figcaption></figure>

### Reading the results

* **Sample**: how many items were checked and the period they were sent in. For **Last 7 days** and **Last 30 days**, a bar per day shows how many items were sampled that day. Older versions of edited content are left out, so each piece of content counts once. The sample can be smaller than you requested, for example when you received less content than that in the period.
* **Outcome**: how many of the checked items **matched**, had **no match** or were **not scored**.
* **Why they matched**: when your top-level conditions are combined with **OR**, this shows how many items each condition or group matched, so you can see which one does most of the work.
* **Matches per condition**: how many items each condition or group matched.
* **Matched content**: the items that matched, 50 per page. Each item shows which condition or group it matched and the evidence, such as `Explicit nudity 92%` or the word that was found.

Click an item to open its details in a drawer, with the same content and user information as the **Content** page.

{% hint style="warning" %}
The content drawer has the regular moderation controls. The backtest itself takes no action, but an action you take in the drawer is real and applies to the content or user straight away.
{% endhint %}

### Exporting the results

Click **Export CSV** next to **Outcome** to download the matched content as a CSV file, for example to review the matches in a spreadsheet or share them with your team. The button appears once a backtest has at least one match. You can export while a backtest is still running: the file then holds the matches found so far.

The file has one row per matched item, in the order they were found, with these columns:

| Column                                | What it holds                                                             |
| ------------------------------------- | ------------------------------------------------------------------------- |
| `content_id`                          | The content ID from your platform                                         |
| `lasso_content_id`                    | Lasso's ID for the content                                                |
| `created_at`                          | When the content was sent                                                 |
| `content_status`                      | The content's current status: `allowed`, `flagged` or `hidden`            |
| `user_id` / `lasso_user_id`           | The user's ID from your platform and Lasso's ID for them                  |
| `user_name`                           | The user's current name                                                   |
| `category_id` / `category_name`       | The content's category                                                    |
| `subcategory_id` / `subcategory_name` | The content's subcategory                                                 |
| `text`                                | The message text, without HTML formatting                                 |
| `content_tags`                        | The content's tags                                                        |
| `matched_branches`                    | The conditions or groups the item matched, such as `Condition 1; Group 2` |

After these comes one column for each condition in your query. Its heading is the condition's label and the condition as it reads in the editor, for example `Group 1:` followed by the condition. The cell shows the evidence when the condition helped the item match, such as `Explicit nudity 92%` or the word that was found, or `matched` when the condition matched without a value to show. The cell is empty when the condition did not help the item match. That includes a condition that was true on its own but sits in a group that did not match.

Like the results on the page, the export only contains content you can see, and the content details are loaded when you export, so a status or user name can differ from when the backtest ran. Images and other media are not included. Use `lasso_content_id` or `content_id` to look an item up in Lasso.

{% hint style="warning" %}
📷 Screenshot placeholder: the Outcome section of a finished backtest with the **Export CSV** button.
{% endhint %}

### How conditions behave on past content

Research works with the data Lasso already has, and that affects some conditions.

**It does not run any new analysis.** Research uses the scores stored when the content came in, and does not call AI models. Content that was never analyzed by a model in your conditions, for example because the model was added later, cannot be decided. When that is the reason an item did not match, it counts as **not scored** instead of **no match**.

**Some conditions use today's data.** These show a **Current data** badge in the condition list. They check the value as it is now, not as it was when the content was sent. A *Signed Up Date* condition measures how old the account is today, *Number of Strikes* counts the user's strikes today, and *Similar Images* compares against the removed images known today. Other details about the user, such as their name, also come from their current profile. Keep this in mind when you compare results to what a rule did at the time.

**Some conditions are unavailable.** *User's Content Volume*, *Topic Volume*, *Unique Project Volume* and *Duplicate Messages* show an **Unavailable** badge and cannot be selected. They rely on counters that are only kept for a short time. If you open a rule that uses one of them in Research, remove that condition before you run the backtest.

**Score comparisons are strict.** With **more than** or **less than**, a score exactly equal to the threshold does not match. When a condition looks at several scores, **more than** matches when any of them is above the threshold, and **less than** only when all of them are below it.

### Using Research with rules

#### Opening a rule in Research

On the page of a content rule, click **Open in Research** at the bottom of the right-hand column. Research opens with the rule's conditions filled in. Your changes in Research do not change the rule. User rules and routing queue rules cannot be opened in Research.

#### Creating a rule from your conditions

Click **Create rule** next to **Run backtest**. Lasso creates a content rule called `Rule from research` with your conditions and opens it for editing, where you can name it and set its actions. The rule starts off, so it does nothing until you enable it. You do not have to run a backtest first.

<figure><img src="https://2736176226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFslADZ1R9paAfD3FHscR%2Fuploads%2Fgit-blob-177ef14a66e68086219d455a5694dc351b02237f%2Fresearch-open-in-research.png?alt=media" alt="The Open in Research button at the bottom of a content rule&#x27;s right-hand column"><figcaption></figcaption></figure>

#### Research, monitor-only rules and the confirmation step

These three all show what a rule would do, at different moments:

* **Research** checks past content, without creating a rule. Use it to explore while you are still working out the conditions.
* The [confirmation step](https://docs.lassomoderation.com/automation-and-review/custom-moderation-rules.md#confirming-a-rule-before-it-goes-live) previews the match counts of a rule you are about to enable or update.
* A [monitor-only rule](https://docs.lassomoderation.com/automation-and-review/custom-moderation-rules.md#monitor-only-rules) is evaluated on new content as it comes in. Use it to see how a rule does on live traffic, including conditions Research cannot check, such as volume conditions.

### Past backtests

**Recent backtests** lists the last 10 backtests in your workspace, with who ran them and their match count. Click one to see its results and load its conditions back into the editor. Backtests are kept for 90 days and are then deleted.

The content in the results is loaded when you view it, so an item can look different from when the backtest ran, for example if a moderator has removed it since.

### Who can use Research

Research is available to Admins. It can be opened to other roles for your workspace on request, see [roles and permissions](https://docs.lassomoderation.com/moderator-toolkit/roles-and-permissions.md). If you do, keep in mind:

* **Category Moderators** only see their own backtests, and their backtests only count content from their assigned categories.
* **Create rule** only appears for roles that can create rules.
