What is Jina?
Tags: python, ai, machinelearning
Published: 2021-07-19 18:36:20

![Jina-AI-Logo](https://raw.githubusercontent.com/jina-ai/jina/master/.github/logo-only.gif)

This Post discusses [Jina](https://jina.ai/), a neural search framework from Jina-AI, in layman terms.

## How is search going now ?
We search the internet for a variety of needs, from finding the lyrics of your favourite song to ordering food online. We use search engines like google to search and get the desired data based on a query. Now what is a query ?

### Query :
It is a precise request for information retrieval with database and information systems.
{% wikipedia https://en.wikipedia.org/wiki/Query %}


Now, after we give a query to a search engine, it begins it's work and responds to our query with the results matching. For example, imagine you search for the new film releasing this weekend, you google it like, `New movie this week release` or `new film near me`. These two phrases we use for searching about the to be released film is the query we give to search engine. Now search engine uses this and retrieve and present us information/data related to the query we gave. This is how the process works.

### Traditional query:
In our day-to-day life, we search (I mean query) search engines using plain text mostly. This approach is traditional. Search engines like Google are for general purpose and cannot be tailored for the business needs. Moreover, this traditional approach is error-prone (User can misspell the queries or some words mean different in different context) This poses a void for Jina to enter the scene.
![Traditional-query](https://uploads-ssl.webflow.com/5c06e16a5bdc7bce10059cc3/5e5540cfdd9a4a409a6ba476_43qyMsRomMThG3bDbaGcFTTcJvTm0xGSbQgqudgVNND6DrfIHrTbVyDbfV0i8-ebnoNNc_snTNTIoA_QL7VcNhr1u0LDeK_0y5iETvjs-ZKZtHfskvcu2b9iT1adp0dXxi0cCfwC.png)
<figcaption>Image source : growhackscale.com</figcaption>

## How Jina works?
Jina, on the other hand, is a neural search framework, meaning it uses a deep learning based Neural Search approach to provide out of the box features. One clear advantage of Jina is that it enables users to query with unstructured data, like images, audio, video, and maps. Sounds cool right? If it didn't awe you, here's another plus, it is **fully customizable and Open-Source**. This means one can easily tailor their search needs with Jina and provide a highly accurate search results for unstructured query.

### Structured and Unstructured data:
Ordered data is known as structured data, for example CSV and XML files. Here, data is categorized and ordered, in the form of rows and columns. Whereas in Unstructured data, such orderliness and categorization is difficult and not found.

Now here Jina wins as it enables users to query with unstructured data like images, videos and more. This is possible because of the fundamental development of Jina is strongly rooted on Neural Search and deep learning. This makes Jina trainable for different use-cases.

![Different-datas](https://lawtomated.com/wp-content/uploads/2019/04/structuredVsUnstructuredIgneos.png)
<figcaption>Image source : lawtomated.com</figcaption>

## Traditional Search VS Neural Search:
Chill, This is not going to be a fight between two ways. Both has their own pros and cons. Like, Neural Search has low query matching capabilities compared to Traditional Search. But Neural Search wins in scalability and customizable factor.

## Using Jina:
We just install Jina using `pip install jina` in a venv. 
Jina works on `flows`, a fundamental component, which manages things to get your application running, each flow takes care of real world task. A flow contains `executor`, executors are like elements which do data processing for our application.

{% gist https://gist.github.com/code-reaper08/6f4cb11414712b201c1fad74757a0b8f %}

We add these executors called MyTransformer and MyIndexer for data encoding and indexing purpose respectively

{% gist https://gist.github.com/code-reaper08/48111d2e8d85e5c8763f5f083a6bb414 %}

We can visualize this flow using plot function

{% gist https://gist.github.com/code-reaper08/818539d1ce24688c2ad39aef60b3d8c7 %}

this generates an SVG like below,

![Generated-SVG](https://jina.ai/assets/images/blog/tutorials/plot_flow1.png)

We now add a name to the executors like below, so that the generated SVG is readable,

{% gist https://gist.github.com/code-reaper08/c17e67535d87576a1c6d393ef5dd7654 %}

This now generates a more readable SVG like below,

![Generated-SVG2](https://jina.ai/assets/images/blog/tutorials/plot_flow2.png)


We then add executors needed for our purpose and begin our work. More detailed explanations are given in [Jina-Docs](https://docs.jina.ai/).

## Contribute to Jina:
Jina adores Open-Source as it's crown and works on community level to get features onboard. Any type of contributions are welcomed, and they have a diverse and inclusive community too. Head over to the [GitHub page](https://github.com/jina-ai/jina/) and start working on issues. If you want to spread a word about Jina, Awesome, do it soon!
Any type of contribution is welcomed.

## Love Jina? Read these blogs too
+ https://dev.to/alexcg/what-is-neural-search-and-why-should-i-care-2gpd
+ https://www.kdnuggets.com/2021/05/what-neural-search.html
+ https://jina.ai/2021/06/28/tutorial.html

Correct me if I am wrong, forgive me if my English is bad.