Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Latest commit

 

History

History
166 lines (109 loc) · 7.21 KB

example_template.md

File metadata and controls

166 lines (109 loc) · 7.21 KB

Run the EXAMPLE NAME

You can also include a gif with a full demo of the example

*ADD A TABLE OF CONTENTS HERE *

Overview

About this example:
Learnings Describe what the user will learn after running this example
Used for indexing What is the datatype of the indexing input
Used for querying What is the data type of the query input
Dataset used Link to the datasets
Model used Link to the model

🐍 Build the app with Python

These instructions explain how to build the example yourself and deploy it with Python. If you want to skip the building steps and just run the example with Docker, check the Docker deployment instructions at the end of this README

🗝️ Requirements

Here outline in bullet points anything the user is expected to have before diving in.

For example:

  1. You have a working Python 3.8 environment.
  2. We recommend creating a new Python virtual environment to have a clean installation of Jina and prevent dependency conflicts.
  3. You have at least 2GB of free space on your hard drive.

👾 Step 1. Clone the repo and install Jina

Begin by cloning the repo, so you can get the required files and datasets. (If you already have the examples repository on your machine make sure to fetch the most recent version)

git clone https://github.com/jina-ai/examples

And enter the correct folder:

cd examples/example_to_use (replace as necessary)

In your terminal, you should now be located in you the enter example name folder. Let's install Jina and the other required Python libraries. For further information on installing Jina check out our documentation.

pip install -r requirements.txt

📥 Step 2. Download your data to search (Optional)

There are two different options here. You can either use the toy data we provide in this repo, which is quick to index but will give very poor results. Alternatively, you can download a larger dataset, which takes longer to index, but will have better results.

  1. Toy dataset: Skip to step 3. No action is needed here.

  2. Full dataset: In order to get the full dataset, follow the instructions below:

🏃 Step 3. Index your data

In this step, we will index our data.

Here describe the Index Flow. Be as specific as possible in describing how this Index Flow works and what is its input. You are encouraged to use code snippets, images, or whatever helps to clarify.

python app.py -t index (replace as necessary)

If you see the following output, it means your data has been correctly indexed.

Flow@5162[S]:flow is closed and all resources are released, current build level is 0

🔎 Step 4: Query your data

Next, we will deploy our query Flow.

Here describe the Query Flow. Be as specific as possible in describing how this Query Flow works and what is its input. You are encouraged to use code snippets, images, or whatever helps to clarify.

Run the query Flow in your terminal like this:

python app.py -t query (replace as necessary)

📉 Understanding your results

Here include a short description of the results and how to interpret them if needed.

🌀 Flow diagram

This diagram provides a visual representation of the Flows in this example; Showing which executors are used in which order.

Here Show the Flow for this example.

📖 Optional: Extra information useful for the user

Use this section to add extra information you think the user could benefit from. QueryLanguage, Faiss, Annoy for example.

🔮 Overview of the files

Add a list with all folders/files in the example:

📂 flows/ Folder to store Flow configuration
--- 📃 index.yml YAML file to configure indexing Flow
--- 📃 query.yml YAML file to configure querying Flow
📂 pods/ Folder to store Pod configuration
--- 📃 encoder.yml YAML file to configure encoder Pod
📂 workspace/ Folder to store indexed files (embeddings and documents). Automatically created after the first indexing

🐋 Deploy with Docker

To make it easier for you, we have built and published the Docker image for this example.

☑️ Requirements:

  1. You have Docker installed and working.
  2. You have at least 8GB of free space on your hard drive.

🏃🏿‍♂️ Pull and run the image

Running the following command will pull the Docker image and run it.

Replace below with the command to run the Docker image of this example

docker .

⏭️ Next steps

Did you like this example and are you interested in building your own? For a detailed tutorial on how to build your Jina app check out How to Build Your First Jina App guide in our documentation.

If you have any issues following this guide, you can always get support from our Slack community .

👩‍👩‍👧‍👦 Community

  • Slack channel - a communication platform for developers to discuss Jina.
  • LinkedIn - get to know Jina AI as a company and find job opportunities.
  • Twitter Follow - follow us and interact with us using hashtag #JinaSearch.
  • Company - know more about our company, we are fully committed to open-source!

🦄 License

Copyright (c) 2021 Jina AI Limited. All rights reserved.

Jina is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.