You are now familiar with the basic concepts of Jina and have experienced its power first-hand. It's time to keep the ball rolling and get started with building cool applications. We will guide you through this journey step-by-step and equip you with all the information required to build real-world examples with Jina.
The first thing to do is find a project that you're optimistic about. That way you'll be motivated to keep working on it. There are some recommendations for the issues from the Jina repository, but you can always work on one that suits your interests.
Don't shy away from asking for help if you get stuck at any step. Reach out to us through Slack!
As a framework, Jina intends to be inclusive of all developers. So, came up with several ways that make it easy for any developer to install and get started with Jina.
If you are using Linux or Mac, you can use this command to install Jina:
pip install -U jina
For Windows users, there are two ways to install and run Jina on your machine:
For both installation types, you can use the above command. Jina is built with *nix-based platforms in mind, and Jina’s dependencies follow a similar ideology. Hence, there are some caveats when running Jina on Windows. If you encounter difficulties, you can check the following page.
To quickly start playing with Jina without worrying about any dependencies, you can install via Docker using the following command:
docker run jinaai/jina:latest
For detailed information on Jina installation, like minimal install or other dependencies, you can check the Install Jina page in our docs. For general troubleshooting, please refer to the following page.
Note: These examples can only be run locally in your terminal; they won't run in a Jupyter Notebook environment such as Google colab. Running them requires extra dependencies that can be installed via:
pip install "jina[demo]"
To get the hang of how an application works with Jina, here are three real-world examples to play with:
Q&A Chatbot
We have created a simple BERT-based Q&A chatbot trained on the CovidQA dataset to answer COVID-related questions. You can replicate the same example to several Q&A tasks by replacing the dataset. For playing with this example, just run the following command:
jina hello chatbot
Fashion Image Search
The Fashion Image Search example explores an image-to-image search example trained on the Fashion-MNIST dataset, containing 60,000 training images and 10,000 test images. It indexes the training images and searches with a randomly-sampled test image based on visual similarity over the vast training data. You can replicate the example to other image-to-image search use cases. To use this example, run the following command:
jina hello fashion
Multimodal Search
Multimodal Search lets you combine multiple modalities in a single query to find the most relevant search results. It isn’t possible to build this kind of search experience with symbolic search, but with neural search you can encode multiple modalities as a single query. This example is trained on an image dataset consisting of 2000 image-caption pairs that combine the image and text modalities.
You can extend this example to any number of multimodal image-text search use cases. For playing with this example, you simply have to run the following command:
jina hello multimodal
In the beginner section, we learned DocArray and how it can be leveraged to massage the data. The other key building blocks of Jina are Executor and Flow. Before we move forward, it's helpful to learn these concepts in depth. Let's go through each of them one by one and understand the nuances behind them.
Creating a new project with Jina is very simple, open the CLI and type the following command:
jina new hello-jina
It will generate a new directory called hello-jina with the following files:
hello-jina
|- app.py
|- executor1/
|- config.yml
|- executor.py
Depending on your use case, you can edit the code in these files and then your application is ready to run. To learn more about creating a project with Jina, check out the following documentation.
Now that you've learned the basics, it's time to get your hands dirty and venture into the code. We have created simple example applications to give you hands-on experience of building with Jina. It will help you understand how Documents, Executor, and Flow work together to create Jina-powered search applications.
We recommend running them locally by cloning the respective GitHub repository.
We at Jina believe in empowering our users to create and build their own examples, so we created Jina Hub. - An open-source marketplace for Executors that allows you to plug and play with different Executors for your applications with just one line of code.
Jina Hub lets you share your work with the world in the form of an Executor. Similarly, you can pull in pre-built Executors like TransformTorchEncoder, CLIPTextEncoder, SimpleIndexer published by others to build your application on top of them. The Hub portal gives you a bird’s eye view of all the Executors on Jina Hub.
JinaHub is built by the community and for the community. By going through the above resources, you have already gained a great understanding of the Jina ecosystem. Why limit all this knowledge to yourself?
It sounds about right to start contributing to the community by building and pushing your executors to JinaHub! We created this tutorial Master Executor: From Zero to Hub that will help you to take your Jina exploration journey to the next level!
You can follow these docs to use , build and publish Executors using Jina Hub along with the best practices .
Using an Executor locally is a resource intensive and time consuming process, so we created an “Executor Sandbox” that lets you try out an Executor remotely in a cloud environment. It saves a lot of time and computing resources on your local machine.
In the previous module, we learned how to prepare and manipulate raw text and image data to make it suitable for neural search applications. Now let’s head over to the examples that will give you a broad context on how to create search applications depending on the data types:
Text
Suppose you have source code in a file and you want to run a grep command in Linux on that file. This is a kind of search system in itself, i.e. searching text inside a bigger text file. We have created a similar semantic code search example using Jina. It indexes the source code as a reference and takes input as a query in the form of code. It then semantically matches the query with the indexed data and produces the desired result.
Chatbots are among the latest trends in the world of artificial intelligence. In this example, we have built an intelligent Q&A chatbot that provides semantically relevant answers when a user inputs a question.
Question Answering on long text documents is an inherently difficult task, due to the fuzziness and ambiguity of human language. There are an infinite number of ways one could ask questions with endless variations in style. One way to solve this problem is to train a neural network on a huge dataset of question-answer pairs, but it isn’t a feasible approach due to the unavailability of dataset. This tutorial will teach you how to reframe this task as a search problem and create robust solutions without the need of any dataset.
Image
In last few examples, you learned how to create a text-to-text search using Jina. Now, it's time to extend the search capabilities to manage images as a data type for doing an image-to-image search. Image to image search allows you to find relevant results by providing an image as an input.
You previously saw examples of text-to-text and image-to-image searche. In this example, you'll learn how Jina's framework implements cross-modal search.
The input query and the output result can be two different data types in a cross-modal search, such as text and images. In this example, we will look at a text-to-image search similar to Google Images, where you enter the description of the image you want to search, and the output is a number of similar images.
In this example, you'll understand a complex image search use case involving image segmentation and object detection. Here we will create a search solution to find small image patches inside larger images.
You are midway through your Neural Search journey with Jina, which means you are already equipped with knowledge for creating basic search solutions.
Take this quiz to move towards the last phase of learning Jina and earn an exclusive intermediate level certificate.
Previous:
Next:
We’d appreciate any feedback you’d have about your experience with the learning bootcamp. Please check it out and provide us with your valuable feedback.