-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
34 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,131 +1,10 @@ | ||
syntax = "proto3"; | ||
import "google/protobuf/struct.proto"; | ||
|
||
package docarray; | ||
option go_package = "github.com/jina-ai/jina-raft/docarray"; | ||
|
||
/** | ||
* Represents a (quantized) dense n-dim array | ||
/* | ||
this file is just a placeholder for the DA coming from docarray dependency | ||
*/ | ||
message DenseNdArrayProto { | ||
// the actual array data, in bytes | ||
bytes buffer = 1; | ||
|
||
// the shape (dimensions) of the array | ||
repeated uint32 shape = 2; | ||
|
||
// the data type of the array | ||
string dtype = 3; | ||
} | ||
|
||
/** | ||
* Represents a general n-dim array, can be either dense or sparse | ||
*/ | ||
message NdArrayProto { | ||
oneof content { | ||
DenseNdArrayProto dense = 1; // dense representation of the ndarray | ||
SparseNdArrayProto sparse = 2; // sparse representation of the ndarray | ||
} | ||
|
||
// the name of the ndarray class | ||
string cls_name = 3; | ||
|
||
google.protobuf.Struct parameters = 4; | ||
} | ||
|
||
/** | ||
* Represents a sparse ndarray | ||
*/ | ||
message SparseNdArrayProto { | ||
// A 2-D int64 tensor of shape [N, ndims], which specifies the indices of the elements in the sparse tensor that contain nonzero values (elements are zero-indexed) | ||
DenseNdArrayProto indices = 1; | ||
|
||
// A 1-D tensor of any type and shape [N], which supplies the values for each element in indices. | ||
DenseNdArrayProto values = 2; | ||
|
||
// A 1-D int64 tensor of shape [ndims], which specifies the shape of the sparse tensor. | ||
repeated uint32 shape = 3; | ||
} | ||
|
||
/** | ||
* Represents the relevance model to `ref_id` | ||
*/ | ||
message NamedScoreProto { | ||
float value = 1; // value | ||
string op_name = 2; // the name of the operator/score function | ||
string description = 3; // text description of the score | ||
string ref_id = 4; // the score is computed between doc `id` and `ref_id` | ||
} | ||
|
||
|
||
/** | ||
* Represents a Document | ||
*/ | ||
message DocumentProto { | ||
// A hexdigest that represents a unique document ID | ||
string id = 1; | ||
|
||
oneof content { | ||
// the raw binary content of this document, which often represents the original document when comes into jina | ||
bytes blob = 2; | ||
|
||
// the ndarray of the image/audio/video document | ||
NdArrayProto tensor = 3; | ||
|
||
// a text document | ||
string text = 4; | ||
} | ||
|
||
// the depth of the recursive chunk structure | ||
uint32 granularity = 5; | ||
|
||
// the width of the recursive match structure | ||
uint32 adjacency = 6; | ||
|
||
// the parent id from the previous granularity | ||
string parent_id = 7; | ||
|
||
// The weight of this document | ||
float weight = 8; | ||
|
||
// a uri of the document could be: a local file path, a remote url starts with http or https or data URI scheme | ||
string uri = 9; | ||
|
||
// modality, an identifier to the modality this document belongs to. In the scope of multi/cross modal search | ||
string modality = 10; | ||
|
||
// mime type of this document, for buffer content, this is required; for other contents, this can be guessed | ||
string mime_type = 11; | ||
|
||
// the offset of the doc | ||
float offset = 12; | ||
|
||
// the position of the doc, could be start and end index of a string; could be x,y (top, left) coordinate of an image crop; could be timestamp of an audio clip | ||
repeated float location = 13; | ||
|
||
// list of the sub-documents of this document (recursive structure) | ||
repeated DocumentProto chunks = 14; | ||
|
||
// the matched documents on the same level (recursive structure) | ||
repeated DocumentProto matches = 15; | ||
|
||
// the embedding of this document | ||
NdArrayProto embedding = 16; | ||
|
||
// a structured data value, consisting of field which map to dynamically typed values. | ||
google.protobuf.Struct tags = 17; | ||
|
||
// Scores performed on the document, each element corresponds to a metric | ||
map<string, NamedScoreProto> scores = 18; | ||
|
||
// Evaluations performed on the document, each element corresponds to a metric | ||
map<string, NamedScoreProto> evaluations = 19; | ||
|
||
// system-defined meta attributes represented in a structured data value. | ||
google.protobuf.Struct _metadata = 20; | ||
|
||
} | ||
|
||
message DocumentArrayProto { | ||
repeated DocumentProto docs = 1; // a list of Documents | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.