Book Image

Neural Search - From Prototype to Production with Jina

By : Jina AI, Bo Wang, Cristian Mitroi, Feng Wang, Shubham Saboo, Susana Guzmán
Book Image

Neural Search - From Prototype to Production with Jina

By: Jina AI, Bo Wang, Cristian Mitroi, Feng Wang, Shubham Saboo, Susana Guzmán

Overview of this book

Search is a big and ever-growing part of the tech ecosystem. Traditional search, however, has limitations that are hard to overcome because of the way it is designed. Neural search is a novel approach that uses the power of machine learning to retrieve information using vector embeddings as first-class citizens, opening up new possibilities of improving the results obtained through traditional search. Although neural search is a powerful tool, it is new and finetuning it can be tedious as it requires you to understand the several components on which it relies. Jina fills this gap by providing an infrastructure that reduces the time and complexity involved in creating deep learning–powered search engines. This book will enable you to learn the fundamentals of neural networks for neural search, its strengths and weaknesses, as well as how to use Jina to build a search engine. With the help of step-by-step explanations, practical examples, and self-assessment questions, you'll become well-versed with the basics of neural search and core Jina concepts, and learn to apply this knowledge to build your own search engine. By the end of this deep learning book, you'll be able to make the most of Jina's neural search design patterns to build an end-to-end search solution for any modality.
Table of Contents (13 chapters)
1
Part 1: Introduction to Neural Search Fundamentals
5
Part 2: Introduction to Jina Fundamentals
8
Part 3: How to Use Jina for Neural Search

DocumentArray

Another powerful concept in Jina is the DocumentArray, which is a list of Document objects. If you need multiple Documents, you can group them all together in a list using DocumentArray. You can use a DocumentArray as a regular list in Python with all of the usual methods, such as insert, delete, construct, traverse, and sort. The DocumentArray is a first-class citizen to an Executor, serving as its input and output. We will talk about Executors in the next section, but for now, think of them as the way Jina processes Documents.

Constructing a DocumentArray

You can construct, delete, insert, sort, and traverse a DocumentArray like a Python list. You can create these in different ways:

from jina import DocumentArray, Document
documentarray = DocumentArray([Document(), Document()])
from jina import DocumentArray, Document
documentarray = DocumentArray((Document() for _ in range(10))
from jina import DocumentArray, Document
documentarray1 = DocumentArray((Document...