
## Relevance AI - The ML Platform for Unstructured Data Analysis
[](https://relevanceai.readthedocs.io/en/latest/?badge=latest)
[](https://img.shields.io/pypi/l/relevanceai)
🌎 80% of data in the world is unstructured in the form of text, image, audio, videos, and more.
🔥 Use Relevance to unlock the value of your unstructured data:
- ⚡ Quickly analyze unstructured data with pre-trained machine learning models in a few lines of code.
- ✨ Visualize your unstructured data. Text highlights from Named entity recognition, Word cloud from keywords, Bounding box from images.
- 📊 Create charts for both structured and unstructured.
- 🔎 Drilldown with filters and similarity search to explore and find insights.
- 🚀 Share data apps with your team.
[Sign up for a free account ->](https://hubs.ly/Q017CkXK0)
Relevance AI also acts as a platform for:
- 🔑 Vectors, storing and querying vectors with flexible vector similarity search, that can be combined with multiple vectors, aggregates and filters.
- 🔮 ML Dataset Evaluation, for debugging dataset labels, model outputs and surfacing edge cases.
## 🧠 Documentation
| Type | Link |
| ------------- | ----------- |
| Python API | [Documentation](https://sdk.tryrelevance.com/) |
| Python Reference | [Documentation](https://relevanceai.readthedocs.io/en/latest/) |
| Cloud Dashboard | [Documentation](https://docs.tryrelevance.com/) |
## 🛠️ Installation
Using pip:
```{bash}
pip install -U relevanceai
```
Using conda:
```{bash}
conda install -c relevance relevanceai
```
## ⏩ Quickstart
[](https://colab.research.google.com/github/RelevanceAI/RelevanceAI/blob/development/guides/quickstart_guide.ipynb)
Login to `relevanceai`:
```{python}
from relevanceai import Client
client = Client()
```
Prepare your documents for insertion by following the below format:
- Each document should be a dictionary
- Include a field `_id` as a primary key, otherwise it's automatically generated
- Suffix vector fields with `_vector_`
```{python}
docs = [
{"_id": "1", "example_vector_": [0.1, 0.1, 0.1], "data": "Documentation"},
{"_id": "2", "example_vector_": [0.2, 0.2, 0.2], "data": "Best document!"},
{"_id": "3", "example_vector_": [0.3, 0.3, 0.3], "data": "document example"},
{"_id": "4", "example_vector_": [0.4, 0.4, 0.4], "data": "this is another doc"},
{"_id": "5", "example_vector_": [0.5, 0.5, 0.5], "data": "this is a doc"},
]
```
### Insert data into a dataset
Create a dataset object with the name of the dataset you'd like to use. If it doesn't exist, it'll be created for you.
```{python}
ds = client.Dataset("quickstart")
ds.insert_documents(docs)
```
> Quick tip! Our Dataset object is compatible with common dataframes methods like `.head()`, `.shape()` and `.info()`.
### Perform vector search
```{python}
query = [
{"vector": [0.2, 0.2, 0.2], "field": "example_vector_"}
]
results = ds.search(
vector_search_query=query,
page_size=3,
)
```
[Learn more about how to flexibly configure your vector search ->](https://sdk.tryrelevance.com/docs/search)
### Perform clustering
Generate clusters
```{python}
clusterop = ds.cluster(vector_fields=["example_vector_"])
clusterop.list_closest()
```
Generate clusters with sklearn
```{python}
from sklearn.cluster import AgglomerativeClustering
cluster_model = AgglomerativeClustering()
clusterop = ds.cluster(vector_fields=["example_vector_"], model=cluster_model, alias="agglomerative")
clusterop.list_closest()
```
[Learn more about how to flexibly configure your clustering ->](https://sdk.tryrelevance.com/docs/search)
## 🧰 Config
The config object contains the adjustable global settings for the SDK. For a description of all the settings, see [here](https://github.com/RelevanceAI/RelevanceAI/blob/development/relevanceai/constants/config.ini).
To view setting options, run the following:
```{python}
client.config.options
```
The syntax for selecting an option is section.key. For example, to disable logging, run the following to modify logging.enable_logging:
```{python}
client.config.set_option('logging.enable_logging', False)
```
To restore all options to their default, run the following:
### Changing the base URL
You can change the base URL as such:
```{python}
client.base_url = "https://.../latest"
```
## 🚧 Development
### Getting Started
To get started with development, ensure you have pytest and mypy installed. These will help ensure typechecking and testing.
```{bash}
python -m pip install pytest mypy
```
Then run testing using:
> Don't forget to set your test credentials!
```{bash}
export TEST_PROJECT = xxx
export TEST_API_KEY = xxx
python -m pytest
mypy relevanceai
```
Set up precommit
```{bash}
pip install precommit
pre-commit install
```
Raw data
{
"_id": null,
"home_page": "https://tryrelevance.com/",
"name": "RelevanceAI-dev",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "Relevance AI",
"author_email": "dev@tryrelevance.com",
"download_url": "https://files.pythonhosted.org/packages/ba/89/e8e8d75cf0dc1f0e865fb0b1d58b615511d8c516f1ca63a6d25ff6521fe0/RelevanceAI-dev-3.2.22.2023.1.3.0.10.55.984477.tar.gz",
"platform": null,
"description": "\n\n## Relevance AI - The ML Platform for Unstructured Data Analysis \n[](https://relevanceai.readthedocs.io/en/latest/?badge=latest)\n[](https://img.shields.io/pypi/l/relevanceai)\n\n\ud83c\udf0e 80% of data in the world is unstructured in the form of text, image, audio, videos, and more.\n\n\ud83d\udd25 Use Relevance to unlock the value of your unstructured data:\n- \u26a1 Quickly analyze unstructured data with pre-trained machine learning models in a few lines of code.\n- \u2728 Visualize your unstructured data. Text highlights from Named entity recognition, Word cloud from keywords, Bounding box from images.\n- \ud83d\udcca Create charts for both structured and unstructured.\n- \ud83d\udd0e Drilldown with filters and similarity search to explore and find insights.\n- \ud83d\ude80 Share data apps with your team.\n\n[Sign up for a free account ->](https://hubs.ly/Q017CkXK0)\n\nRelevance AI also acts as a platform for:\n- \ud83d\udd11 Vectors, storing and querying vectors with flexible vector similarity search, that can be combined with multiple vectors, aggregates and filters.\n- \ud83d\udd2e ML Dataset Evaluation, for debugging dataset labels, model outputs and surfacing edge cases.\n\n\n## \ud83e\udde0 Documentation\n\n| Type | Link |\n| ------------- | ----------- |\n| Python API | [Documentation](https://sdk.tryrelevance.com/) |\n| Python Reference | [Documentation](https://relevanceai.readthedocs.io/en/latest/) |\n| Cloud Dashboard | [Documentation](https://docs.tryrelevance.com/) |\n\n## \ud83d\udee0\ufe0f Installation\n\nUsing pip:\n\n```{bash}\npip install -U relevanceai\n```\nUsing conda:\n\n```{bash}\nconda install -c relevance relevanceai\n```\n\n## \u23e9 Quickstart\n[](https://colab.research.google.com/github/RelevanceAI/RelevanceAI/blob/development/guides/quickstart_guide.ipynb)\n\nLogin to `relevanceai`:\n```{python}\nfrom relevanceai import Client\n\nclient = Client()\n```\n\nPrepare your documents for insertion by following the below format:\n- Each document should be a dictionary\n- Include a field `_id` as a primary key, otherwise it's automatically generated\n- Suffix vector fields with `_vector_`\n\n```{python}\ndocs = [\n {\"_id\": \"1\", \"example_vector_\": [0.1, 0.1, 0.1], \"data\": \"Documentation\"},\n {\"_id\": \"2\", \"example_vector_\": [0.2, 0.2, 0.2], \"data\": \"Best document!\"},\n {\"_id\": \"3\", \"example_vector_\": [0.3, 0.3, 0.3], \"data\": \"document example\"},\n {\"_id\": \"4\", \"example_vector_\": [0.4, 0.4, 0.4], \"data\": \"this is another doc\"},\n {\"_id\": \"5\", \"example_vector_\": [0.5, 0.5, 0.5], \"data\": \"this is a doc\"},\n]\n```\n\n### Insert data into a dataset\n\nCreate a dataset object with the name of the dataset you'd like to use. If it doesn't exist, it'll be created for you.\n\n```{python}\nds = client.Dataset(\"quickstart\")\nds.insert_documents(docs)\n```\n> Quick tip! Our Dataset object is compatible with common dataframes methods like `.head()`, `.shape()` and `.info()`.\n\n### Perform vector search\n\n```{python}\nquery = [\n {\"vector\": [0.2, 0.2, 0.2], \"field\": \"example_vector_\"}\n]\nresults = ds.search(\n vector_search_query=query,\n page_size=3,\n)\n```\n[Learn more about how to flexibly configure your vector search ->](https://sdk.tryrelevance.com/docs/search)\n\n### Perform clustering\n\nGenerate clusters\n```{python}\nclusterop = ds.cluster(vector_fields=[\"example_vector_\"])\nclusterop.list_closest()\n```\n\nGenerate clusters with sklearn\n```{python}\nfrom sklearn.cluster import AgglomerativeClustering\n\ncluster_model = AgglomerativeClustering()\nclusterop = ds.cluster(vector_fields=[\"example_vector_\"], model=cluster_model, alias=\"agglomerative\")\nclusterop.list_closest()\n```\n[Learn more about how to flexibly configure your clustering ->](https://sdk.tryrelevance.com/docs/search)\n\n## \ud83e\uddf0 Config\n\nThe config object contains the adjustable global settings for the SDK. For a description of all the settings, see [here](https://github.com/RelevanceAI/RelevanceAI/blob/development/relevanceai/constants/config.ini).\n\nTo view setting options, run the following:\n\n```{python}\nclient.config.options\n```\n\nThe syntax for selecting an option is section.key. For example, to disable logging, run the following to modify logging.enable_logging:\n\n```{python}\nclient.config.set_option('logging.enable_logging', False)\n```\n\nTo restore all options to their default, run the following:\n\n### Changing the base URL\n\nYou can change the base URL as such:\n\n```{python}\nclient.base_url = \"https://.../latest\"\n```\n\n## \ud83d\udea7 Development\n\n### Getting Started\nTo get started with development, ensure you have pytest and mypy installed. These will help ensure typechecking and testing.\n\n```{bash}\npython -m pip install pytest mypy\n```\n\nThen run testing using:\n\n> Don't forget to set your test credentials!\n\n```{bash}\nexport TEST_PROJECT = xxx\nexport TEST_API_KEY = xxx\n\npython -m pytest\nmypy relevanceai\n```\n\nSet up precommit\n\n```{bash}\npip install precommit\npre-commit install\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "",
"version": "3.2.22.2023.1.3.0.10.55.984477",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1f16d5a625dc49783873010ce4d623df4636d4d7f15590954561b0060dae014f",
"md5": "1520dd91e06fbe521b2d3b5abed4e425",
"sha256": "361e50fa9862efcaab723317cf45da975383b48c4d518df986058fb2a745f1fe"
},
"downloads": -1,
"filename": "RelevanceAI_dev-3.2.22.2023.1.3.0.10.55.984477-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1520dd91e06fbe521b2d3b5abed4e425",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 427754,
"upload_time": "2023-01-03T00:10:58",
"upload_time_iso_8601": "2023-01-03T00:10:58.452100Z",
"url": "https://files.pythonhosted.org/packages/1f/16/d5a625dc49783873010ce4d623df4636d4d7f15590954561b0060dae014f/RelevanceAI_dev-3.2.22.2023.1.3.0.10.55.984477-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ba89e8e8d75cf0dc1f0e865fb0b1d58b615511d8c516f1ca63a6d25ff6521fe0",
"md5": "ed9dd1b5aa65667ee181134b21fde446",
"sha256": "b23ea5ae26377d5e40bd53907152d8a08c1638156d4e1c25c83735ff41a78270"
},
"downloads": -1,
"filename": "RelevanceAI-dev-3.2.22.2023.1.3.0.10.55.984477.tar.gz",
"has_sig": false,
"md5_digest": "ed9dd1b5aa65667ee181134b21fde446",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 301679,
"upload_time": "2023-01-03T00:11:00",
"upload_time_iso_8601": "2023-01-03T00:11:00.293644Z",
"url": "https://files.pythonhosted.org/packages/ba/89/e8e8d75cf0dc1f0e865fb0b1d58b615511d8c516f1ca63a6d25ff6521fe0/RelevanceAI-dev-3.2.22.2023.1.3.0.10.55.984477.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-03 00:11:00",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "relevanceai-dev"
}