Quick Start Guide
Welcome to the Quick Start guide for Acadia. This guide will walk you through the basic steps to get up and running with Acadia, from installation to launching your first dataset console.
Installation
Before you begin, ensure that you have Python installed on your system. Acadia is compatible with Python 3.6 and above.
To install Acadia, run the following command in your terminal:
pip install acadia
Step 1: Initialize Acadia
First, initialize Acadia with a directory where Acadia will manage its data:
import acadia
TEST_DIR = "./acadia_project"
acadia.init(TEST_DIR)
Step 2: Create a Dataset
You can easily create a dataset from a CSV file:
data_source = acadia.data_sources.CSVDataSource("human_eval.csv", sample_size=1000)
config = acadia.DatasetConfig(
name="human_eval",
description="test description",
columns=["id", "caption_0", "caption_1"],
id_column="id",
text_preview_column="caption_0",
source=data_source
)
dataset = acadia.dataset.create_dataset(config)
Step 3: Manage Topics
Load example root topics or define your own:
# Load example root topics
topic_dict_list = acadia.topic.load_example_root_topics()
# Or define your own
topic_dict_list = [{
"name": "Environment",
"description": "Topics related to environmental issues",
"children": [{"name": "Pollution", "description": "Issues related to pollution"}]
}]
# Add root topics to the dataset
topic_tree = acadia.topic.add_root_topics(dataset, topic_dict_list)
print(topic_tree)
Step 4: Embed Datums
Define a dimension reduction model and an embedding model:
dim_reduction_model = acadia.models.dimension_reduction_models.MockDimensionReductionModel(
dims=2, normalize=True, hyperparameter_1=0.5, hyperparameter_2=0.5
)
embedding_model = acadia.models.datum_embedding_models.MockDatumEmbeddingModel(
task_context="Embedding context",
columns_to_embed={"caption_0": "text", "caption_1": "text"},
dim_reduction_model=dim_reduction_model
)
# Embed datums in the dataset
acadia.datum.embed_datums(dataset, embedding_model)
Step 5: Tag Datums
Tag datums using a custom tagging model:
tagging_model = acadia.models.tagging_models.MockTaggingModel(
task_context="Tagging context",
columns_to_tag={"caption_0": "text", "caption_1": "text"}
)
acadia.tag.tag_datums(dataset, tagging_model)
Step 6: Launch Console
Finally, launch the Acadia console to interact with your dataset visually:
acadia.console.launch_console(dataset_name="human_eval")
This will start both the backend and the frontend, allowing you to interact with the dataset through a web interface.
Conclusion
Congratulations! You've successfully navigated the basics of Acadia. Explore the detailed documentation to learn more about advanced features and customization options.