<!-- Source: https://docs.squirro.com/en/latest/technical/communities/how-setup.html -->
# Communities Tutorial

Profile: Project Creator

Communities is a feature that allows end users to follow topics that interest them within a Squirro project. In this tutorial, you’ll learn how to set up communities and associated [Known Entity Extraction (KEEs)](../../a-z/squirro-glossary.md#term-KEE) using the Squirro UI in your browser.

This tutorial is geared toward Project Creators and assumes familiarity with the basics of project creation, dashboard editing, and data loading.

## Overview

In this tutorial, you’ll perform the following steps:

1. Create a community type.
2. Add communities using an Excel file.
3. Configure the community type to automatically label ingested data with a KEE.
4. Load sample data.
5. Visualize communities.
6. Add a second new community type.
7. Rerun the pipeline to label data with your new community type.

## Creating and Configuring a Community Type

To create and configure your first community type, follow the steps below:

1. Click Setup in the top-right navigation menu.
2. Click the Data tab.
3. Click Communities in the side navigation menu.
4. Click Add Community or the plus-icon to create a new community type.

[![Creating a community type navigation](https://s3.amazonaws.com/download.squirro.net/docs/technical/communities/navigate-comm.png)](https://s3.amazonaws.com/download.squirro.net/docs/technical/communities/navigate-comm.png)

Fill in the fields as follows:

| Field | Description |
| --- | --- |
| Name: | Name the community type `Company`. |
| Choose a label to map to: | Communities are linked (mapped) to a label. To set up this community type, you first want to create the label to which you’ll link the communities. Under Choose a label top map to select the option Create label…, then enter `Company` for the _Title_ and `company` for the _Name_ and click Save. |
| Upload file: | Select Upload file and upload the following Excel file: [`Company Communities Excel File`](../../_downloads/2c0ad7ef1caf3f4925b5743dbdd38e33/communities_company.xlsx) |
| Content labeling (Known Entity Extraction): | Check the option to _Automatically label ingested data with these communities_ and select _Company names: optimized model to detect company names_. |

[![](https://s3.amazonaws.com/download.squirro.net/docs/technical/communities/communities_tutorial_setup.png)](https://s3.amazonaws.com/download.squirro.net/docs/technical/communities/communities_tutorial_setup.png)

1. Click Next.

Tip: You may need to refresh the browser window or click Import to see the communities populate.

## Load Data

During the set up of the community type, you specified the option to create a KEE. As a result, the Community Type KEE is automatically added to all pipeline workflows and maps incoming data with the labels value specified in the uploaded Excel file.

Now, load the provided data to see this in action:

[`Download Sample NYT Items`](../../_downloads/6a7ff966ecf51574b5f487c6ba34202a/NYT-sample-items-business-rss.json)

Reference: For more information about data loading, view [Data Loading](https://learn.squirro.com/learn/course/78/data-loading) course offerings and resources at the [Squirro Academy](https://learn.squirro.com).

## Visualize Communities

You can now create a new dashboard to experiment with visualizing communities using the three primary community widgets by completing the following steps:

1. Click Setup in the top-right navigation menu.
2. Click the Visualization tab.
3. Click the orange plus icon to create a new dashboard.
4. In the _Dashboard Properties_, give the dashboard a title and enable the Right Section.

[![Creating a new communities dashboard](https://s3.amazonaws.com/download.squirro.net/docs/technical/communities/enable-right.png)](https://s3.amazonaws.com/download.squirro.net/docs/technical/communities/enable-right.png)

Reference: For a detailed overview of community widgets, see [Visualizing Communities](visualization.md#communities-visualization).

### Left Section

In this section, you’ll add a Tabs widget to visualize all the communities a user follows.

By default, when you create a new dashboard and open the Left Section, a _Labels_ widget is pre-populated.

You can either delete the widget and replace it with a Tabs widget by clicking Add Widget and selecting or searching for Tabs, or you can edit the Labels widget and change the Type within _Widget Properties_.

[![Changing Labels widget to Tabs widget](https://s3.amazonaws.com/download.squirro.net/docs/technical/communities/select-tabs.png)](https://s3.amazonaws.com/download.squirro.net/docs/technical/communities/select-tabs.png)

Once you have a Tabs widget, scroll down and select the Show user Communities checkbox. This will visualize a user’s communities however you select.

For a narrow column like this, visualizing by Vertical tabs likely makes the most sense.

Reference: See [Tabs](visualization.md#communities-visualization-tabs) for full configuration options.

### Center Section

With more space to work with, this section is a good candidate for the Community Items widget.

By default, when you open the Center Section, you’ll see a Rich Text widget and a Search Bar widget.

You don’t need the Rich Text widget, so replace it with a Community Items (or Headlines) widget by clicking Add Widget and selecting or searching for Community Items, or you can edit the Rich Text widget and change the Type within _Widget Properties_.

Resize the widget appropriately, and configure it as you’d like. Your widget should look something like the following example:

[![Communities Items widget in the Dashboard Editor](https://s3.amazonaws.com/download.squirro.net/docs/technical/communities/items-center.png)](https://s3.amazonaws.com/download.squirro.net/docs/technical/communities/items-center.png)

Reference: See [Community Items](visualization.md#communities-visualization-items) for full configuration options.

### Right Section

Now you can add the final primary communities widget: Community List. This widget will list out available communities for users to follow or unfollow.

Click the Right Section, then click Add Widget and select or search for Community List. Drag it into place and resize to fit.

Configure the widget as you prefer. Your widget should look something like the following example:

[![Communities List widget in the Dashboard Editor](https://s3.amazonaws.com/download.squirro.net/docs/technical/communities/right-list.png)](https://s3.amazonaws.com/download.squirro.net/docs/technical/communities/right-list.png)

Reference: See [Community List](visualization.md#communities-visualization-list) for full configuration options.

## Add a Second Community Type

Now, try adding another community type manually by following the steps below:

1. Click Setup in the top-right navigation menu.
2. Click the Data tab.
3. Click Communities in the side navigation menu.
4. Click Add Community or the plus-icon to create a new community type.

> **Note**
>
> Labels are termed `facets` in the Squirro code. Any time the code references `facets`, it is referencing what the UI calls _labels_.

Fill in the fields as follows:

- **Name:** Name the community type `Person`.
- **Choose a label to map to:** Communities are linked (mapped) to a label as described earlier. Under Choose a label to map to, select the option Create label… In the _Add Label_ window, enter the _Title_ `Person` and _Name_ `person` and click Save. This selects the newly-created label `Person`.
- **Upload file: Select Add manually and enter the following into the text box:**

  ```
  name,facet_value
  Donald Trump,Donald Trump
  ```
- **Content labeling (Known Entity Extraction):** Check the option to _Automatically label ingested data with these communities_ and select _Generic labeling_.

Tip: You may need to refresh the browser window or click Import to see the communities populate.

1. Manually add a second community for _Michael Lewis_ by clicking the Add button (next to the magnifier icon top right) and entering `Michael Lewis` for the name and `michaellewis` for the label.

Now, to map the communities to existing data, you need to [rerun](../data-processing/pipeline-rerun.md#data-processing-pipeline-rerun) the KEE that was created when you set up the communities.

1. Navigate to Setup > Pipeline
2. Click the orange pencil icon to enter Edit` mode.
3. Hover over the `Community Type Person KEE` step and click the three dots that appear.
4. Click Rerun, leaving _Run linked steps_ checked and the query field blank.

[![Rerun Person KEE](https://s3.amazonaws.com/download.squirro.net/docs/technical/communities/pipeline-rerun.png)](https://s3.amazonaws.com/download.squirro.net/docs/technical/communities/pipeline-rerun.png)

Congratulations, you’ve now created two different community types and generated communities!

After giving the pipeline a minute or two to run, go to your project dashboard and check for the newly added _Person_ community.

## Troubleshooting

**If something doesn’t seem to be working properly, how can I check for error messages?**

Navigate to the project title in the upper-left corner (next to the Squirro icon), click to open the Projects menu, and then navigate to Squirro Monitoring. There you can investigate log files of issues occurring within your project.
