diff --git a/.dockerignore b/.dockerignore index eec609af3..e191ae500 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,6 @@ +#marqo assets +assets/ + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/README-translated/README-Chinese.md b/README-translated/README-Chinese.md deleted file mode 100644 index 0db5ff38a..000000000 --- a/README-translated/README-Chinese.md +++ /dev/null @@ -1,270 +0,0 @@ -

- Marqo -

- -

Marqo

- -

- Tensor search for humans. -

- -

- - - -PyPI - Downloads from pepy - -

- - -这是一个开源的张量(tensor)搜索引擎。它可以无缝地整合到你的应用、网页、工作流程中。 - -Marqo云服务☁正在测试中。 如果你感兴趣的话,你可以在这里申请:https://q78175g1wwa.typeform.com/to/d0PEuRPC - -## 什么是张量(tensor)搜索? - -张量搜索是一个涉及到把文件、图片和其他数据转换成一个向量集合(我们称之为张量)的过程。通过张量来表示数据可以允许我们像人类那样去匹配搜索请求和文件。张量搜索可以助力众多的应用场景包括: -- 用户搜索和推荐系统 -- 多模式搜索(图片搜图片,文字搜图片,图片搜文字) -- 聊天机器人和自动问答系统 -- 文字和图片分类 - -

- -

- - - -## 让我们开始吧 - -1. Marqo 需要 docker的支持. 安装docker请点击 [Docker Official website.](https://docs.docker.com/get-docker/) -2. 通过docker来运行Marqo (M系列芯片的Mac用户需要点击这里 [go here](#m-series-mac-users)): -```bash -docker rm -f marqo; -docker pull marqoai/marqo:latest; -docker run --name marqo -it --privileged -p 8882:8882 --add-host host.docker.internal:host-gateway marqoai/marqo:latest -``` -3. 安装 Marqo client: -```bash -pip install marqo -``` -4. 开始索引和搜索! 让我们用下面这个简单的例子来示范: - -```python -import marqo - -mq = marqo.Client(url='http://localhost:8882') - -#添加索引文件 -mq.index("my-first-index").add_documents([ - { - "Title": "The Travels of Marco Polo", - "Description": "A 13th-century travelogue describing Polo's travels" - }, - { - "Title": "Extravehicular Mobility Unit (EMU)", - "Description": "The EMU is a spacesuit that provides environmental protection, " - "mobility, life support, and communications for astronauts", - "_id": "article_591" - }] -) -#进行第一次搜索 -results = mq.index("my-first-index").search( - q="What is the best outfit to wear on the moon?" -) - -``` - -- `mq` 是一个把包含 `marqo` 客户端(Client)的接口(API) -- `add_documents()` 包括一系列的文件。文件通过Python的字典(Dict)表示,并进行索引 -- `add_documents()` 会再索引不存在的前提下,用默认的设置生成索引 -- 你可以选择要不要通过 `_id` 来设置一个文件编号(ID). Marqo也可以帮你自动生成 -- 如果索引不存在的话,Marqo就会生成一个。 如果索引存在的话,Marqo就会把文件添加到当前索引中。 - -我们一起来看看结果如何: - -```python -# 输出结果: -import pprint -pprint.pprint(results) - -{ - 'hits': [ - { - 'Title': 'Extravehicular Mobility Unit (EMU)', - 'Description': 'The EMU is a spacesuit that provides environmental protection, mobility, life support, and' - 'communications for astronauts', - '_highlights': { - 'Description': 'The EMU is a spacesuit that provides environmental protection, ' - 'mobility, life support, and communications for astronauts' - }, - '_id': 'article_591', - '_score': 0.61938936 - }, - { - 'Title': 'The Travels of Marco Polo', - 'Description': "A 13th-century travelogue describing Polo's travels", - '_highlights': {'Title': 'The Travels of Marco Polo'}, - '_id': 'e00d1a8d-894c-41a1-8e3b-d8b2a8fce12a', - '_score': 0.60237324 - } - ], - 'limit': 10, - 'processingTimeMs': 49, - 'query': 'What is the best outfit to wear on the moon?' -} -``` - -- 每一个 `hit` 代表一个匹配搜索请求的文件 -- 他们以最匹配到最不匹配的方式排序 -- `limit` 是能够返回的最大结果数量。 这个可以在搜索中作为参数进行设置 -- 每一个 `hit` 都有一个 `_highlights` 部分. 这是返回文件中和搜索请求最匹配的部分 - - -## 其他基本操作 - -### 获取文件 -通过ID获取文件. - -```python -result = mq.index("my-first-index").get_document(document_id="article_591") -``` - -注意: 通过 ```add_documents``` 添加文件并且使用同一个```_id``` 会导致文件的覆盖且更新。 - -### 获取索引状态 -获取索引的信息。 - -```python -results = mq.index("my-first-index").get_stats() -``` - -### 词汇搜索(Lexical search) -进行一起关键搜索. - -```python -result = mq.index("my-first-index").search('marco polo', search_method=marqo.SearchMethods.LEXICAL) -``` - -### 搜索特定的域(field) -使用默认的张量搜索方法 -```python -result = mq.index("my-first-index").search('adventure', searchable_attributes=['Title']) -``` - -### 删除文件 -删除一些文件。 - -```python -results = mq.index("my-first-index").delete_documents(ids=["article_591", "article_602"]) -``` - -### 删除索引 -删除一些索引。 - -```python -results = mq.index("my-first-index").delete() -``` - -## 多模型、跨模型搜索 - -为了支持文字和图片搜索, Marqo允许用户接入并且调试来自于HuggingFace的CLIP模型. **注意:如果你没有在参数中设置多模型搜索, 图片urls将会被当做字符串(string)处理.** 在开始图片索引和搜索执勤啊, 我们首先要设置一个 CLIP 模型的配置, 方法如下: - -```python - -settings = { - "treat_urls_and_pointers_as_images":True, # allows us to find an image file and index it - "model":"ViT-L/14" -} -response = mq.create_index("my-multimodal-index", **settings) -``` - -图片能够以如下方式添加到文件中. 你可以使用来自互联网的 urls (例如百度图) 或者自己硬盘上的图片: - -```python - -response = mq.index("my-multimodal-index").add_documents([{ - "My Image": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f2/Portrait_Hippopotamus_in_the_water.jpg/440px-Portrait_Hippopotamus_in_the_water.jpg", - "Description": "The hippopotamus, also called the common hippopotamus or river hippopotamus, is a large semiaquatic mammal native to sub-Saharan Africa", - "_id": "hippo-facts" -}]) - -``` - -然后你就可以和之前一样搜索文字. 该搜索会同时搜索文字和图片域: -```python - -results = mq.index("my-multimodal-index").search('animal') - -``` - 把 `searchable_attributes` 设置成图片域 `['My Image'] ` 会让你只在图片域中进行这次索引: - -```python - -results = mq.index("my-multimodal-index").search('animal', searchable_attributes=['My Image']) - -``` - -### 用图片搜索 -我们可以通过提供图片链接的方式来进行图片搜索 -```python -results = mq.index("my-multimodal-index").search('https://upload.wikimedia.org/wikipedia/commons/thumb/9/96/Standing_Hippopotamus_MET_DP248993.jpg/440px-Standing_Hippopotamus_MET_DP248993.jpg') -``` - -## 文档 -关于Marqo的完整文档可以在这里获取[https://marqo.pages.dev/](https://marqo.pages.dev/). - -## 注意 -注意请不要在Marqo的开源搜索引擎中运行其他的应用。Marqo会自动更新、改变引擎上的设置。 - -## M系列芯片的Mac用户 -对于arm64架构,Marqo 暂未支持 docker-in-docker 后端配置. 这意味着如果你使用M系列Mac, 你需在在本地运行marqo的后端, marqo-os. - -如果你想在M系列Mac上运行Marco, 请按照如下步骤: - -1. 在一个终端(terminal) 运行如下命令来启动引擎: - -```shell -docker rm -f marqo-os; docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" marqoai/marqo-os:0.0.3-arm -``` - -2. 在另一个终端(terminal)运行如下命令来启动Marqo: -```shell -docker rm -f marqo; docker run --name marqo --privileged \ - -p 8882:8882 --add-host host.docker.internal:host-gateway \ - -e "OPENSEARCH_URL=https://localhost:9200" \ - marqoai/marqo:latest -``` - -## 贡献者 -Marqo是一个社区项目。我们的目标是让张量搜索能够被更多的开发者群体使用。 -如果你愿意提供帮助我们会非常开心!请阅读[这里](./CONTRIBUTING.md)来开始你的贡献。 - -## 开发者设置 -1. 创建一个新的 virtual env ```python -m venv ./venv``` -2. 激活 virtual environment ```source ./venv/bin/activate``` -3. 通过需求列表安装需要的文件: ```pip install -r requirements.txt``` -4. 运行 tox 文件进行测试。 -5. 如果你更新了环境, 确保你删除了.tox 文件夹并再洗运行。 - -## 如何合并: -1. 运行所有的测试 (通过运行文件夹下的 `tox` 文件). -2. 创建一个 pull request 并附带一个issue. - - - - -## 支持 - -- 加入我们的 [Slack社区](https://join.slack.com/t/marqo-community/shared_invite/zt-1d737l76e-u~b3Rvey2IN2nGM4wyr44w) 并和其他社区成员分享你的看法 -- Marqo 社区面对面 (正在筹备中!) - -**Translations:** - -- [English](../README.md)🇬🇧 -- [Français](README-French.md)🇫🇷 -- [中文 Chinese](README-Chinese.md)🇨🇳 -- [Polski](README-Polish.md)🇵🇱 -- [Українська](README-Ukrainian.md)🇺🇦 - - diff --git a/README-translated/README-French.md b/README-translated/README-French.md deleted file mode 100644 index 44bc059e2..000000000 --- a/README-translated/README-French.md +++ /dev/null @@ -1,271 +0,0 @@ -

- Marqo -

- -

Marqo

- -

- Recherche de tenseur pour les humains. -

- -

- - - -PyPI - Downloads from pepy - -

- - -Un moteur de recherche de tenseur open-source qui s'intègre de manière transparente à vos applications, sites web et flux de travail. - -Marqo cloud ☁️ est actuellement en version bêta. Si vous êtes intéressé, postulez ici : https://q78175g1wwa.typeform.com/to/d0PEuRPC - -## Qu'est-ce que la recherche tensorielle ? - -La recherche tensorielle consiste à transformer des documents, des images et d'autres données en collections de vecteurs appelés "tenseurs". La représentation des données sous forme de tenseurs nous permet de faire correspondre des requêtes à des documents avec une compréhension de type humain du contenu de la requête et du document. La recherche tensorielle peut être utilisée dans de nombreux cas, tels que -- la recherche et les recommandations pour l'utilisateur final -- la recherche multimodale (image à image, texte à image, image à texte) -- les robots de chat et les systèmes de questions-réponses -- la classification de textes et d'images - -

- -

- - - -## Pour débuter - -1. Marqo nécessite Docker. Pour installer Docker, allez sur le [site officiel de Docker] (https://docs.docker.com/get-docker/). -2. Utilisez Docker pour exécuter Marqo (les utilisateurs de Mac avec des puces M-series devront [aller ici](#m-series-mac-users)) : -```bash -docker rm -f marqo; -docker pull marqoai/marqo:latest; -docker run --name marqo -it --privileged -p 8882:8882 --add-host host.docker.internal:host-gateway marqoai/marqo:latest -``` -3. Installez le client Marqo : -```bash -pip install marqo -``` -4. Commencez l'indexation et la recherche ! Prenons un exemple simple ci-dessous : - -```python -import marqo - -mq = marqo.Client(url='http://localhost:8882') - -mq.index("my-first-index").add_documents([ - { - "Title": "The Travels of Marco Polo", - "Description": "A 13th-century travelogue describing Polo's travels" - }, - { - "Title": "Extravehicular Mobility Unit (EMU)", - "Description": "The EMU is a spacesuit that provides environmental protection, " - "mobility, life support, and communications for astronauts", - "_id": "article_591" - }] -) - -results = mq.index("my-first-index").search( - q="What is the best outfit to wear on the moon?" -) - -``` - -- `mq` est le client qui enveloppe l'API `marqo`. -- `add_documents()` prend une liste de documents, représentés comme des dicts python, pour l'indexation -- `add_documents()` crée un index avec des paramètres par défaut, s'il n'en existe pas encore. -- Vous pouvez optionnellement définir l'ID d'un document avec le champ spécial `_id`. Sinon, Marqo va en générer un. -- Si l'index n'existe pas, Marqo le créera. S'il existe, Marqo ajoutera les documents à l'index. - -Regardons les résultats : - -```python -# let's print out the results: -import pprint -pprint.pprint(results) - -{ - 'hits': [ - { - 'Title': 'Extravehicular Mobility Unit (EMU)', - 'Description': 'The EMU is a spacesuit that provides environmental protection, mobility, life support, and' - 'communications for astronauts', - '_highlights': { - 'Description': 'The EMU is a spacesuit that provides environmental protection, ' - 'mobility, life support, and communications for astronauts' - }, - '_id': 'article_591', - '_score': 0.61938936 - }, - { - 'Title': 'The Travels of Marco Polo', - 'Description': "A 13th-century travelogue describing Polo's travels", - '_highlights': {'Title': 'The Travels of Marco Polo'}, - '_id': 'e00d1a8d-894c-41a1-8e3b-d8b2a8fce12a', - '_score': 0.60237324 - } - ], - 'limit': 10, - 'processingTimeMs': 49, - 'query': 'What is the best outfit to wear on the moon?' -} -``` - -- Chaque hit correspond à un document qui correspond à la requête de recherche. -- Ils sont classés du plus au moins correspondant -- `limit` est le nombre maximum de résultats à retourner. Il peut être défini comme un paramètre pendant la recherche. -- Chaque résultat a un champ `_highlights`. C'est la partie du document qui correspond le mieux à la requête. - - -## Autres opérations de base - -### Obtenir un document -Récupère un document par ID. - -```python -result = mq.index("my-first-index").get_document(document_id="article_591") -``` - -Notez qu'en ajoutant le document en utilisant ``add_documents`` à nouveau en utilisant le même ``_id``, un document sera mis à jour. - -### Obtenir les statistiques d'un index -Obtenez des informations sur un index. - -```python -results = mq.index("my-first-index").get_stats() -``` - -### Recherche lexicale -Effectuer une recherche par mot-clé. - -```python -result = mq.index("my-first-index").search('marco polo', search_method=marqo.SearchMethods.LEXICAL) -``` - -### Recherche de champs spécifiques -Utiliser la méthode de recherche tensorielle par défaut -```python -result = mq.index("my-first-index").search('adventure', searchable_attributes=['Title']) -``` - -### Supprimer des documents -Supprimer des documents. - -```python -results = mq.index("my-first-index").delete_documents(ids=["article_591", "article_602"]) -``` - -### Supprimer un index -Supprime un index. - -```python -results = mq.index("my-first-index").delete() -``` - -## Recherche multi modale et inter modale - -Pour alimenter la recherche d'images et de textes, Marqo permet aux utilisateurs de brancher et de jouer avec les modèles CLIP de HuggingFace. **Pour commencer à indexer et à rechercher des images, créez d'abord un index avec une configuration CLIP, comme ci-dessous : - -```python - -settings = { - "treat_urls_and_pointers_as_images":True, # allows us to find an image file and index it - "model":"ViT-L/14" -} -response = mq.create_index("my-multimodal-index", **settings) -``` - -Les images peuvent ensuite être ajoutées dans les documents comme suit. Vous pouvez utiliser des urls provenant de l'internet (par exemple S3) ou du disque de la machine : - -```python - -response = mq.index("my-multimodal-index").add_documents([{ - "My Image": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f2/Portrait_Hippopotamus_in_the_water.jpg/440px-Portrait_Hippopotamus_in_the_water.jpg", - "Description": "The hippopotamus, also called the common hippopotamus or river hippopotamus, is a large semiaquatic mammal native to sub-Saharan Africa", - "_id": "hippo-facts" -}]) - -``` - -Vous pouvez ensuite effectuer une recherche par texte comme d'habitude. Les champs de texte et d'image seront recherchés : -```python - -results = mq.index("my-multimodal-index").search('animal') - -``` - Setting `searchable_attributes` to the image field `['My Image'] ` ensures only images are searched in this index: - -```python - -results = mq.index("my-multimodal-index").search('animal', searchable_attributes=['My Image']) - -``` - -### Recherche à l'aide d'une image -La recherche à l'aide d'une image peut être réalisée en fournissant le lien de l'image. -```python -results = mq.index("my-multimodal-index").search('https://upload.wikimedia.org/wikipedia/commons/thumb/9/96/Standing_Hippopotamus_MET_DP248993.jpg/440px-Standing_Hippopotamus_MET_DP248993.jpg') -``` - -## Documentation -La documentation complète de Marqo se trouve ici [https://marqo.pages.dev/](https://marqo.pages.dev/). - -## Avertissement - -Notez que vous ne devez pas exécuter d'autres applications sur le cluster Opensearch de Marqo car Marqo modifie et adapte automatiquement les paramètres du cluster. - -## Les utilisateurs de Mac série M -Marqo ne prend pas encore en charge la configuration du backend docker-in-docker pour l'architecture arm64. Cela signifie que si vous avez un Mac série M, vous devrez également exécuter le backend de Marqo, marqo-os, localement. - -Pour exécuter Marqo sur un Mac série M, suivez les étapes suivantes. - -1. Dans un terminal, exécutez la commande suivante pour lancer opensearch : - -```shell -docker rm -f marqo-os; docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" marqoai/marqo-os:0.0.3-arm -``` - -2. Dans un autre terminal, exécutez la commande suivante pour lancer Marqo : -```shell -docker rm -f marqo; docker run --name marqo --privileged \ - -p 8882:8882 --add-host host.docker.internal:host-gateway \ - -e "OPENSEARCH_URL=https://localhost:9200" \ - marqoai/marqo:latest -``` - -## Contributeurs -Marqo est un projet communautaire dont l'objectif est de rendre la recherche tensorielle accessible à l'ensemble de la communauté des développeurs. Nous sommes heureux que vous soyez intéressés à nous aider ! Veuillez lire [this](./CONTRIBUTING.md) pour commencer. - -## Mise en place de l'environnement de développement -1. Créer un environnement virtuel ``python -m venv ./venv``. -2. Activez l'environnement virtuel ``source ./venv/bin/activate`` -3. Installez les exigences à partir du fichier d'exigences : ``pip install -r requirements.txt`` -4. Lancez les tests en exécutant le fichier tox. Placez le CD dans ce répertoire et exécutez "tox". -5. Si vous mettez à jour les dépendances, assurez-vous de supprimer le répertoire .tox et de réexécuter le fichier. - -## Instructions de fusion : -1. Exécutez la suite de tests complète (en utilisant la commande `tox` dans ce répertoire). -2. Créez une demande de pull avec un problème github attaché. - - -## Soutenez - -- Rejoignez notre [communauté Slack] (https://join.slack.com/t/marqo-community/shared_invite/zt-1d737l76e-u~b3Rvey2IN2nGM4wyr44w) et discutez de vos idées avec les autres membres de la communauté. -- Réunions de la communauté Marqo (à venir !) - -### Stargazers -[!Liste de repo de Stargazers pour @marqo-ai/marqo](https://reporoster.com/stars/marqo-ai/marqo)](https://github.com/marqo-ai/marqo/stargazers) - -### Forkers -[ ![Liste des repo des braconniers pour @marqo-ai/marqo](https://reporoster.com/forks/marqo-ai/marqo)](https://github.com/marqo-ai/marqo/network/members) - - -## Traductions - -Ce fichier readme est disponible dans les traductions suivantes : - -- [中文 Chinois](README-translated/README-Chinese.md)🇨🇳 -- [Français](README-translated/README-French.md) diff --git a/README-translated/README-Polish.md b/README-translated/README-Polish.md deleted file mode 100644 index b4357c72f..000000000 --- a/README-translated/README-Polish.md +++ /dev/null @@ -1,274 +0,0 @@ -

- Marqo -

- -

Marqo

- -

- Tensor search for humans. -

- -

- - - -PyPI - Downloads from pepy - -

- - -Wyszukiwarka tensorowa typu open source, która bezproblemowo integruje się z Twoimi aplikacjami, witrynami internetowymi i cyklami produkcji. - -Chmura Marqo ☁️ jest obecnie w fazie beta. Jeśli jesteś zainteresowany, zgłoś się tutaj: https://q78175g1wwa.typeform.com/to/d0PEuRPC - -## What is tensor search? - -Wyszukiwanie tensorowe polega na przekształcaniu dokumentów, obrazów i innych danych w zbiory wektorów zwane „tensorami”. Reprezentowanie danych jako tensory pozwala nam dopasować zapytania do dokumentów z ludzkim zrozumieniem zapytania i treści dokumentu. Wyszukiwanie tensorowe może wspomagać różne przypadki użycia, takie jak: -- wyszukiwanie i rekomendacje użytkowników końcowych -- wyszukiwanie multimodalne (obraz na obraz, tekst na obraz, obraz na tekst) -- boty czatowe oraz systemy pytań i odpowiedzi -- klasyfikacja tekstu i obrazu - -

- -

- - - -## Pierwsze kroki - -1. Marqo wymaga dokera. Aby zainstalować Docker, przejdź do [Docker oficjalna strona.](https://docs.docker.com/get-docker/) -2. Użyj dokera, aby uruchomić Marqo (Mac users with M-series chips will need to [go here](#m-series-mac-users)): -```bash -docker rm -f marqo; -docker pull marqoai/marqo:latest; -docker run --name marqo -it --privileged -p 8882:8882 --add-host host.docker.internal:host-gateway marqoai/marqo:latest -``` -3. Zainstaluj klienta Marqo: -```bash -pip install marqo -``` -4. Rozpocznij indeksowanie i wyszukiwanie! Spójrzmy na prosty przykład poniżej: - -```python -import marqo - -mq = marqo.Client(url='http://localhost:8882') - -mq.index("my-first-index").add_documents([ - { - "Title": "The Travels of Marco Polo", - "Description": "A 13th-century travelogue describing Polo's travels" - }, - { - "Title": "Extravehicular Mobility Unit (EMU)", - "Description": "The EMU is a spacesuit that provides environmental protection, " - "mobility, life support, and communications for astronauts", - "_id": "article_591" - }] -) - -results = mq.index("my-first-index").search( - q="What is the best outfit to wear on the moon?" -) - -``` - -- `mq` to klient, który otacza API `marqo` -- `add_documents()` pobiera do indeksowania listę dokumentów, reprezentowanych jako dykty Pythona -- `add_documents()` tworzy indeks z ustawieniami domyślnymi, jeśli jeszcze nie istnieje -- Możesz opcjonalnie ustawić identyfikator dokumentu za pomocą specjalnego pola `_id`. W przeciwnym razie Marqo wygeneruje jeden. -- Jeśli indeks nie istnieje, Marqo go stworzy. Jeśli istnieje, Marqo doda dokumenty do indeksu. - -Przyjrzyjmy się wynikom: - -```python -# let's print out the results: -import pprint -pprint.pprint(results) - -{ - 'hits': [ - { - 'Title': 'Extravehicular Mobility Unit (EMU)', - 'Description': 'The EMU is a spacesuit that provides environmental protection, mobility, life support, and' - 'communications for astronauts', - '_highlights': { - 'Description': 'The EMU is a spacesuit that provides environmental protection, ' - 'mobility, life support, and communications for astronauts' - }, - '_id': 'article_591', - '_score': 0.61938936 - }, - { - 'Title': 'The Travels of Marco Polo', - 'Description': "A 13th-century travelogue describing Polo's travels", - '_highlights': {'Title': 'The Travels of Marco Polo'}, - '_id': 'e00d1a8d-894c-41a1-8e3b-d8b2a8fce12a', - '_score': 0.60237324 - } - ], - 'limit': 10, - 'processingTimeMs': 49, - 'query': 'What is the best outfit to wear on the moon?' -} -``` - -– Każde trafienie odpowiada dokumentowi pasującemu do zapytania -– Są uporządkowane od najbardziej pasujących do najmniej pasujących -– `limit ` to maksymalna liczba trafień do zwrócenia. Można to ustawić jako parametr podczas wyszukiwania -– Każde trafienie ma pole `_highlights `. To była ta część dokumentu, która najlepiej pasowała do zapytania. - - -## Inne podstawowe operacje - -### Pobierz dokument -Pobierz dokument według ID. - -```python -result = mq.index("my-first-index").get_document(document_id="article_591") -``` - -Zauważ, że dodanie dokumentu za pomocą ```add_documents``` ponownie przy użyciu tego samego ```_id``` spowoduje aktualizację dokumentu. - -### Uzyskaj statystyki indeksu -Uzyskaj informacje o indeksie. - -```python -results = mq.index("my-first-index").get_stats() -``` - -### Wyszukiwanie leksykalne -Przeprowadź wyszukiwanie słów kluczowych. - -```python -result = mq.index("my-first-index").search('marco polo', search_method=marqo.SearchMethods.LEXICAL) -``` - -### Wyszukaj określone pola -Korzystanie z domyślnej metody wyszukiwania tensorów -```python -result = mq.index("my-first-index").search('adventure', searchable_attributes=['Title']) -``` - -### Usuń dokumenty -Usuń dokumenty. - -```python -results = mq.index("my-first-index").delete_documents(ids=["article_591", "article_602"]) -``` - -### Usuń indeks -Usuń indeks. - -```python -results = mq.index("my-first-index").delete() -``` - -## Wyszukiwanie multimodalne i crossmodalne - -Do obsługi wyszukiwania obrazów i tekstu, Marqo umożliwia użytkownikom podłączanie i odtwarzanie modeli CLIP firmy HuggingFace. **Pamiętaj, że jeśli nie skonfigurujesz wyszukiwania multimodalnego, adresy URL obrazów będą traktowane jako ciągi.** Aby rozpocząć indeksowanie i wyszukiwanie za pomocą obrazów, najpierw utwórz indeks z konfiguracją CLIP, jak poniżej: - -```python - -settings = { - "treat_urls_and_pointers_as_images":True, # allows us to find an image file and index it - "model":"ViT-L/14" -} -response = mq.create_index("my-multimodal-index", **settings) -``` - -Obrazy można następnie dodawać w dokumentach w następujący sposób. Możesz użyć adresów URL z Internetu (na przykład S3) lub z dysku maszyny: - -```python - -response = mq.index("my-multimodal-index").add_documents([{ - "My Image": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f2/Portrait_Hippopotamus_in_the_water.jpg/440px-Portrait_Hippopotamus_in_the_water.jpg", - "Description": "The hippopotamus, also called the common hippopotamus or river hippopotamus, is a large semiaquatic mammal native to sub-Saharan Africa", - "_id": "hippo-facts" -}]) - -``` - -Następnie możesz wyszukiwać jak zwykle, używając tekstu. Przeszukiwane będą zarówno pola tekstowe, jak i graficzne: -```python - -results = mq.index("my-multimodal-index").search('animal') - -``` - Ustawienie parametru `searchable_attributes` jako pole obrazu `['My Image'] ` gwarantuje, że w tym indeksie będą przeszukiwane tylko obrazy: - -```python - -results = mq.index("my-multimodal-index").search('animal', searchable_attributes=['My Image']) - -``` - -### Wyszukiwanie za pomocą obrazu -Wyszukiwanie za pomocą obrazu można osiągnąć, podając link do obrazu. -```python -results = mq.index("my-multimodal-index").search('https://upload.wikimedia.org/wikipedia/commons/thumb/9/96/Standing_Hippopotamus_MET_DP248993.jpg/440px-Standing_Hippopotamus_MET_DP248993.jpg') -``` - -## Dokumentacja -Pełna dokumentacja Marqo znajduje się tutaj: [https://marqo.pages.dev/](https://marqo.pages.dev/). - -## Ostrzeżenie - -Pamiętaj, że nie powinieneś uruchamiać innych aplikacji w klastrze Opensearch Marqo, ponieważ Marqo automatycznie zmienia i dostosowuje ustawienia w klastrze. - -## M series Mac użytkownicy -Marqo nie obsługuje jeszcze konfiguracji zaplecza docker-in-docker dla architektury arm64. Oznacza to, że jeśli masz komputer Mac z serii M, będziesz musiał również uruchomić lokalnie backend marqo, marqo-os. - -Aby uruchomić Marqo na komputerze Mac z serii M, wykonaj następujące kroki. - -1. W jednym terminalu uruchom następujące polecenie, aby rozpocząć opensearch: - -```shell -docker rm -f marqo-os; docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" marqoai/marqo-os:0.0.3-arm -``` - -2. W innym terminalu uruchom następujące polecenie, aby uruchomić Marqo: -```shell -docker rm -f marqo; docker run --name marqo --privileged \ - -p 8882:8882 --add-host host.docker.internal:host-gateway \ - -e "OPENSEARCH_URL=https://localhost:9200" \ - marqoai/marqo:latest -``` - -## Kontrybutorzy -Marqo to projekt społecznościowy, którego celem jest udostępnienie wyszukiwania tensorowego szerszej społeczności programistów. Cieszymy się, że jesteś zainteresowany pomocą! Aby rozpocząć, przeczytaj [to](./CONTRIBUTING.md) - -## Dev set up -1. Utwórz wirtualne środowisko ```python -m venv ./venv``` -2. Aktywuj środowisko wirtualne ```source ./venv/bin/activate``` -3. Zainstaluj wymagania z pliku wymagań: ```pip install -r requirements.txt``` -4. Uruchom testy, uruchamiając plik tox. CD do tego dir, a następnie uruchom "tox" -5. Jeśli aktualizujesz zależności, Upewnij się, że usunięto dir .tox i uruchom ponownie - -## Merge instrukcje: -1. Uruchom pełny zestaw testowy (za pomocą komendy `tox` w tym dir). -2. Utwórz pull request z dołączonym rozwiązaniem. - - -## Support - -- Dołączć do naszego [Slack community](https://join.slack.com/t/marqo-community/shared_invite/zt-1d737l76e-u~b3Rvey2IN2nGM4wyr44w) i rozmawiaj z innymi członkami społeczności o pomysłach. -- Spotkania społeczności Marqo (już wkrótce!) - -### Stargazers -[![Stargazers repo roster for @marqo-ai/marqo](https://reporoster.com/stars/marqo-ai/marqo)](https://github.com/marqo-ai/marqo/stargazers) - -### Forkers -[![Forkers repo roster for @marqo-ai/marqo](https://reporoster.com/forks/marqo-ai/marqo)](https://github.com/marqo-ai/marqo/network/members) - - -## Tłumaczenia - -Ten plik readme jest dostępny w następujących tłumaczeniach: - -- [English](../README.md)🇬🇧 -- [Français](README-French.md)🇫🇷 -- [中文 Chinese](README-Chinese.md)🇨🇳 -- [Polski](README-Polish.md)🇵🇱 -- [Українська](README-Ukrainian.md)🇺🇦 diff --git a/README-translated/README-Ukrainian.md b/README-translated/README-Ukrainian.md deleted file mode 100644 index 5c53fc55c..000000000 --- a/README-translated/README-Ukrainian.md +++ /dev/null @@ -1,274 +0,0 @@ -

- Marqo -

- -

Marqo

- -

- Tensor search for humans. -

- -

- - - -PyPI - Downloads from pepy - -

- - -Пошукова система тензором з відкритим кодом, яка легко інтегрується з вашими програмами, веб-сайтами та робочим процесом. - -Marqo хмара ☁️ на даний момент в бета-версії. Якщо ви зацікавлені, зверніться [сюди.](https://q78175g1wwa.typeform.com/to/d0PEuRPC) - -## Що таке тензорний пошук (tensor search)? - -Тензорний пошук (tensor search) передбачає перетворення документів, зображень та інших данних в набір векторів, що називаються "тензори". Представлення данних у вигляді тензорів дозволяє нам зіставити запити з документами з людиноподібним розумінням цього запиту і змісту документа. Тензорний пошук може бути сильним рішенням у багатьох випадках користування, наприклад: - -- пошук і рекомендації кінцевого користувача -- мультимодальний пошук (картинка до картинки, текст до картинки, картинка до тексту) -- чат боти і системи запитань та відповідей -- класифікація тексту та зображення - -

- -

- - - -## Початок роботи - -1. Marqo потребує docker. Для встановлення Docker перейдіть до [Docker Official website.](https://docs.docker.com/get-docker/) -2. Використовуйте docker для запуску Marqo (Користувачам Мас з чіпом серії М потрібно буде [перейти сюди](#m-series-mac-users)): -```bash -docker rm -f marqo; -docker pull marqoai/marqo:latest; -docker run --name marqo -it --privileged -p 8882:8882 --add-host host.docker.internal:host-gateway marqoai/marqo:latest -``` -3. Встановіть клієнт Marqo: -```bash -pip install marqo -``` -4. Почніть індексування та пошук! Розгляньмо простий приклад нижче: - -```python -import marqo - -mq = marqo.Client(url='http://localhost:8882') - -mq.index("my-first-index").add_documents([ - { - "Title": "The Travels of Marco Polo", - "Description": "A 13th-century travelogue describing Polo's travels" - }, - { - "Title": "Extravehicular Mobility Unit (EMU)", - "Description": "The EMU is a spacesuit that provides environmental protection, " - "mobility, life support, and communications for astronauts", - "_id": "article_591" - }] -) - -results = mq.index("my-first-index").search( - q="What is the best outfit to wear on the moon?" -) - -``` - -- `mq` це клієнт, що обгортає `marqo` API -- `add_documents()` приймає список документів, представлених як словники python, для індексування -- `add_documents()` створює індекс зі стандартними налаштуваннями, якщо такого не існує -- За бажання, ви можете встановити ID документа за допомогою спеціального `_id` поля. Інакше, Marqo згенерує такий -- Якщо індекс не існує, Marqo створить його. Якщо він існує, то Marqo додасть документи до індексу - -Погляньмо на результати: - -```python -# let's print out the results: -import pprint -pprint.pprint(results) - -{ - 'hits': [ - { - 'Title': 'Extravehicular Mobility Unit (EMU)', - 'Description': 'The EMU is a spacesuit that provides environmental protection, mobility, life support, and' - 'communications for astronauts', - '_highlights': { - 'Description': 'The EMU is a spacesuit that provides environmental protection, ' - 'mobility, life support, and communications for astronauts' - }, - '_id': 'article_591', - '_score': 0.61938936 - }, - { - 'Title': 'The Travels of Marco Polo', - 'Description': "A 13th-century travelogue describing Polo's travels", - '_highlights': {'Title': 'The Travels of Marco Polo'}, - '_id': 'e00d1a8d-894c-41a1-8e3b-d8b2a8fce12a', - '_score': 0.60237324 - } - ], - 'limit': 10, - 'processingTimeMs': 49, - 'query': 'What is the best outfit to wear on the moon?' -} -``` - -- Кожен збіг відповідає документу, який збігається з пошуковим запитом -- Вони впорядковані від найбільш до найменш відповідних -- `limit` це максимальне число збігів, які слід повернути. Це може бути встановлено як параметр під час пошуку -- Кожен збіг має поле `_highlights`. Це частина документа, яка найкраще збігалася з запитом - - -## Інші базові операції - -### Отримати документ -Отримати документ за ID. - -```python -result = mq.index("my-first-index").get_document(document_id="article_591") -``` - -Зверніть увагу, що додавання документа за допомогою ```add_documents``` повторно використовуючи той самий ```_id``` призведе до того, що документ буде оновлено. - -### Отримати статистику індексу -Отримати інформацію про індекс. - -```python -results = mq.index("my-first-index").get_stats() -``` - -### Лексичний пошук -Виконати пошук за ключовим словом. - -```python -result = mq.index("my-first-index").search('marco polo', search_method=marqo.SearchMethods.LEXICAL) -``` - -### Знайти конкретні поля -Використовуючи стандартний метод тензорного пошуку -```python -result = mq.index("my-first-index").search('adventure', searchable_attributes=['Title']) -``` - -### Видалити документи -Видалити документи. - -```python -results = mq.index("my-first-index").delete_documents(ids=["article_591", "article_602"]) -``` - -### Видалити індекс -Видалити індекс. - -```python -results = mq.index("my-first-index").delete() -``` - -## Мультимодальний та перехресно-модальний пошук - -Для підсилення пошуку зображень та тексту, Marqo дозволяє користувачам підключати та працювати з CLIP моделями від HuggingFace. **Зверніть увагу, якщо ви не налаштуєте мультимодальний пошук, адреси зображень будуть розглядатися як рядки.** Для початку індексування та пошуку з зображеннями, спершу створіть індекс з конфігурацією CLIP, як показано нижче: - -```python - -settings = { - "treat_urls_and_pointers_as_images":True, # allows us to find an image file and index it - "model":"ViT-L/14" -} -response = mq.create_index("my-multimodal-index", **settings) -``` - -Зображення потім можуть бути додані до документу в такий спосіб. Ви можете використати посилання з інтернету (наприклад S3) або з диску комп'ютера: - -```python - -response = mq.index("my-multimodal-index").add_documents([{ - "My Image": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f2/Portrait_Hippopotamus_in_the_water.jpg/440px-Portrait_Hippopotamus_in_the_water.jpg", - "Description": "The hippopotamus, also called the common hippopotamus or river hippopotamus, is a large semiaquatic mammal native to sub-Saharan Africa", - "_id": "hippo-facts" -}]) - -``` - -Після цього ви можете виконувати пошук за текстом як зазвичай. Пошук буде здійснюватися як по тексту, так і по картинкам: -```python - -results = mq.index("my-multimodal-index").search('animal') - -``` - Встановлення `searchable_attributes` для поля зображення `['My Image'] ` гарантує пошук лише зображень у цьому індексі: - -```python - -results = mq.index("my-multimodal-index").search('animal', searchable_attributes=['My Image']) - -``` - -### Пошук за зображенням -Пошук за зображенням можна виконати, використовуючи посилання на зображення. -```python -results = mq.index("my-multimodal-index").search('https://upload.wikimedia.org/wikipedia/commons/thumb/9/96/Standing_Hippopotamus_MET_DP248993.jpg/440px-Standing_Hippopotamus_MET_DP248993.jpg') -``` - -## Документація -Повну документацію Marqo можна знайти тут [https://marqo.pages.dev/](https://marqo.pages.dev/). - -## Увага -Зверніть увагу, що вам не слід запускати інші програми на кластері Marqo's Opensearch, оскільки Marqo автоматично змінює та адаптує налаштування на кластері. - -## Користувачі Mac серії M -Marqo ще не підтримує docker-in-docker бекенд конфігурацію для архітектури arm64. Це означає, якщо ви використовуєте Mac серії M, вам також знадобиться запустити marqo's бекенд, marqo-os, локально. - -Для запуску Marqo на Mac серії M, виконайте наступні кроки. - -1. В одному терміналі запустіть наступну команду для початку opensearch: - -```shell -docker rm -f marqo-os; docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" marqoai/marqo-os:0.0.3-arm -``` - -2. В іншому терміналі запустіть наступну команду для запуску Marqo: -```shell -docker rm -f marqo; docker run --name marqo --privileged \ - -p 8882:8882 --add-host host.docker.internal:host-gateway \ - -e "OPENSEARCH_URL=https://localhost:9200" \ - marqoai/marqo:latest -``` - -## Зробити внесок -Marqo - це ком'юніті проект, метою якого є розповсюдити тензорний пошук для ширшої спільноти розробників. Ми раді, що ви зацікавлені у допомозі! Будь ласка, прочитайте [це](./CONTRIBUTING.md) для початку - -## Dev set up -1. Створити віртуальне середовище ```python -m venv ./venv``` -2. Активувати віртуальне середовище ```source ./venv/bin/activate``` -3. Встановити пакети з файлу: ```pip install -r requirements.txt``` -4. Виконати тести запустивши файл tox. CD до цієї папки, потім запустити "tox" -5. Якщо ви оновлюєте залежності, переконайтесь, що видалили папку .tox та перезапустіть - -## Merge інструкції: -1. Запустити повний набір тестів (використовуючи команду `tox` в цій папці). -2. Створіть pull request з прикріпленим github issue. - - -## Підтримка - -- Приєднайтесь до нашого [Slack community](https://join.slack.com/t/marqo-community/shared_invite/zt-1d737l76e-u~b3Rvey2IN2nGM4wyr44w) та спілкуйтесь з іншими учасниками спільноти щодо ідей. -- Зустрічі спільноти Marqo (скоро буде!) - -### Stargazers -[![Stargazers repo roster for @marqo-ai/marqo](https://reporoster.com/stars/marqo-ai/marqo)](https://github.com/marqo-ai/marqo/stargazers) - -### Forkers -[![Forkers repo roster for @marqo-ai/marqo](https://reporoster.com/forks/marqo-ai/marqo)](https://github.com/marqo-ai/marqo/network/members) - - -## Translations - -Це readme доступно в наступних перекладах: - -- [English](../README.md)🇬🇧 -- [中文 Chinese](README-Chinese.md)🇨🇳 -- [Polski](README-Polish.md)🇵🇱 -- [Українська](README-Ukrainian.md)🇺🇦 -- [Français](README-French.md)🇫🇷 diff --git a/README.md b/README.md index 022c28cbd..abbb4fca4 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

-Website | Documentation | Demos | Slack Community | Marqo Cloud +Website | Documentation | Demos | Discourse | Slack Community | Marqo Cloud

@@ -12,62 +12,65 @@ -

-Marqo is an end-to-end, multimodal vector search engine. With Marqo, users can store and query unstructured data such as text, images, and code through a single easy-to-use API. Input preprocessing, machine learning inference, and storage are all included out of the box and can be easily scaled. +Marqo is more than a vector database, it's an end-to-end vector search engine. Vector generation, storage and retrieval are handled out of the box through a single API. No need to bring your own embeddings.


- +

- - - - - ## ✨ Core Features -**⚡ Performance** -- Embeddings stored in in-memory HNSW indexes, achieving cutting edge search speeds. -- Scale to hundred-million document indexes with horizontal index sharding. -- Async and non-blocking data upload and search. -**🤖 Machine Learning** +**🤖 State of the art embeddings** - Use the latest machine learning models from PyTorch, Huggingface, OpenAI and more. - Start with a pre-configured model or bring your own. -- Built in ONNX support and conversion for faster inference and higher throughput. +- Built-in ONNX support and conversion for faster inference and higher throughput. - CPU and GPU support. -**☁️ Cloud-native** -- Fast deployment using Docker. -- Run Marqo high availability. +**⚡ Performance** +- Embeddings stored in in-memory HNSW indexes, achieving cutting edge search speeds. +- Scale to hundred-million document indexes with horizontal index sharding. +- Async and non-blocking data upload and search. -**🌌 End-to-end** -- Build search and analytics on multiple unstructured data types such as text, image, code, video. +**🌌 Documents-in-documents-out** +- Vector generation, storage, and retieval are provided out of the box. +- Build search, entity resolution, and data exploration application with using your text and images. +- Build complex semantic queries by combining weighted search terms. - Filter search results using Marqo’s query DSL. - Store unstructured data and semi-structured metadata together in documents, using a range of supported datatypes like bools, ints and keywords. **🍱 Managed cloud** -- Scale Marqo at the click of a button. -- High availability, accelerated inference. -- Marqo cloud ☁️ is in pre-release. If you’re interested, [apply here](https://q78175g1wwa.typeform.com/to/d0PEuRPC). +- Low latency optimised deployment of Marqo. +- Scale inference at the click of a button. +- High availability. +- 24/7 support. +- Access control. +- Learn more [here](https://www.marqo.ai/cloud). -

- -

+## Integrations + +Marqo is integrated into popular AI and data processing frameworks, with more on the way. + +**🛹 [Griptape](https://github.com/griptape-ai/griptape)** + +Griptape enables safe and reliable deployment of LLM-based agents for enterprise applications, the MarqoVectorStoreDriver gives these agents access to scalable search with your own data. This integration lets you leverage open source or custom fine-tuned models through Marqo to deliver relevant results to your LLMs. + +**🦜🔗 [Langchain](https://github.com/langchain-ai/langchain)** + +This integration lets you leverage open source or custom fine tuned models through Marqo for LangChain applications with a vector search component. The Marqo vector store implementation can plug into existing chains such as the Retrieval QA and Conversational Retrieval QA. ## Learn more about Marqo | | | | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 📗 [Quick start](#Getting-started)| Build your first application with Marqo in under 5 minutes. | -| 🔍 [ What is tensor search?](https://medium.com/@jesse_894/introducing-marqo-build-cloud-native-tensor-search-applications-in-minutes-9cb9a05a1736) | A beginner's guide to the fundamentals of Marqo and tensor search. | -| 🖼 [Marqo for image data](https://medium.com/@wanli19940222/how-to-implement-text-to-image-search-on-marqo-in-5-lines-of-code-448f75bed1da) | Building text-to-image search in Marqo in 5 lines of code. | -| 📚 [Marqo for text](https://medium.com/@pandu_95301/how-i-used-marqo-to-create-a-multilingual-legal-database-in-5-key-lines-of-code-42ba49fd0caa) | Building a multilingual database in Marqo. | -| 🔮 [Integrating Marqo with GPT](https://medium.com/creator-fund/building-search-engines-that-think-like-humans-e019e6fb6389) | Making GPT a subject matter expert by using Marqo as a knowledge base. | -| 🎨 [ Marqo for Creative AI](https://medium.com/@jesse_894/combining-stable-diffusion-with-semantic-search-generating-and-categorising-100k-hot-dogs-afeeddea9d81) | Combining stable diffusion with semantic search to generate and categorise 100k images of hotdogs. | +| 🖼 [Marqo for image data](https://www.marqo.ai/blog/context-is-all-you-need-multimodal-vector-search-with-personalization) | Building advanced image search with Marqo. | +| 📚 [Marqo for text](https://www.marqo.ai/blog/how-i-used-marqo-to-create-a-multilingual-legal-databse-in-5-key-lines-of-code) | Building a multilingual database in Marqo. | +| 🔮 [Integrating Marqo with GPT](https://www.marqo.ai/blog/from-iron-manual-to-ironman-augmenting-gpt-with-marqo-for-fast-editable-memory-to-enable-context-aware-question-answering) | Making GPT a subject matter expert by using Marqo as a knowledge base. | +| 🎨 [ Marqo for Creative AI](https://www.marqo.ai/blog/combining-stable-diffusion-with-semantic-search-generating-and-categorising-100k-hot-dogs) | Combining stable diffusion with semantic search to generate and categorise 100k images of hotdogs. | | 🔊 [Marqo and Speech Data](https://www.marqo.ai/blog/speech-processing) | Add diarisation and transcription to preprocess audio for Q&A with Marqo and ChatGPT. | | 🦾 [Features](#-Core-Features) | Marqo's core features. | @@ -495,8 +498,8 @@ Marqo is a community project with the goal of making tensor search accessible to ## Support +- Ask questions and share your creations with the community on our [Discourse forum](https://community.marqo.ai). - Join our [Slack community](https://join.slack.com/t/marqo-community/shared_invite/zt-1d737l76e-u~b3Rvey2IN2nGM4wyr44w) and chat with other community members about ideas. -- Marqo community meetings (coming soon!). ### Stargazers @@ -505,14 +508,3 @@ Marqo is a community project with the goal of making tensor search accessible to ### Forkers [![Forkers repo roster for @marqo-ai/marqo](https://reporoster.com/forks/marqo-ai/marqo)](https://github.com/marqo-ai/marqo/network/members). - -## Translations - -This readme is available in the following translations: - -- [English](README.md)🇬🇧 -- [Français](README-translated/README-French.md)🇫🇷 -- [中文 Chinese](README-translated/README-Chinese.md)🇨🇳 -- [Polski](README-translated/README-Polish.md)🇵🇱 -- [Українська](README-translated/README-Ukrainian.md)🇺🇦 - diff --git a/assets/00_marqo_diagram_MAIN-COMP-1080-1920-01.gif b/assets/00_marqo_diagram_MAIN-COMP-1080-1920-01.gif new file mode 100644 index 000000000..ea3093c63 Binary files /dev/null and b/assets/00_marqo_diagram_MAIN-COMP-1080-1920-01.gif differ diff --git a/assets/join-the-cloud-beta.png b/assets/join-the-cloud-beta.png deleted file mode 100644 index 2c039c653..000000000 Binary files a/assets/join-the-cloud-beta.png and /dev/null differ