#[non_exhaustive]pub struct GcsTrainingInput {
pub corpus_data_path: String,
pub query_data_path: String,
pub train_data_path: String,
pub test_data_path: String,
/* private fields */
}search-tuning-service only.Expand description
Cloud Storage training data input.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.corpus_data_path: StringThe Cloud Storage corpus data which could be associated in train data.
The data path format is gs://<bucket_to_data>/<jsonl_file_name>.
A newline delimited jsonl/ndjson file.
For search-tuning model, each line should have the _id, title
and text. Example:
{"_id": "doc1", title: "relevant doc", "text": "relevant text"}
query_data_path: StringThe gcs query data which could be associated in train data.
The data path format is gs://<bucket_to_data>/<jsonl_file_name>.
A newline delimited jsonl/ndjson file.
For search-tuning model, each line should have the _id and text. Example: {“_id”: “query1”, “text”: “example query”}
train_data_path: StringCloud Storage training data path whose format should be
gs://<bucket_to_data>/<tsv_file_name>. The file should be in tsv
format. Each line should have the doc_id and query_id and score (number).
For search-tuning model, it should have the query-id corpus-id
score as tsv file header. The score should be a number in [0, inf+).
The larger the number is, the more relevant the pair is. Example:
query-id\tcorpus-id\tscorequery1\tdoc1\t1
test_data_path: StringCloud Storage test data. Same format as train_data_path. If not provided, a random 80/20 train/test split will be performed on train_data_path.
Implementations§
Source§impl GcsTrainingInput
impl GcsTrainingInput
pub fn new() -> Self
Sourcepub fn set_corpus_data_path<T: Into<String>>(self, v: T) -> Self
pub fn set_corpus_data_path<T: Into<String>>(self, v: T) -> Self
Sets the value of corpus_data_path.
§Example
let x = GcsTrainingInput::new().set_corpus_data_path("example");Sourcepub fn set_query_data_path<T: Into<String>>(self, v: T) -> Self
pub fn set_query_data_path<T: Into<String>>(self, v: T) -> Self
Sets the value of query_data_path.
§Example
let x = GcsTrainingInput::new().set_query_data_path("example");Sourcepub fn set_train_data_path<T: Into<String>>(self, v: T) -> Self
pub fn set_train_data_path<T: Into<String>>(self, v: T) -> Self
Sets the value of train_data_path.
§Example
let x = GcsTrainingInput::new().set_train_data_path("example");Sourcepub fn set_test_data_path<T: Into<String>>(self, v: T) -> Self
pub fn set_test_data_path<T: Into<String>>(self, v: T) -> Self
Sets the value of test_data_path.
§Example
let x = GcsTrainingInput::new().set_test_data_path("example");Trait Implementations§
Source§impl Clone for GcsTrainingInput
impl Clone for GcsTrainingInput
Source§fn clone(&self) -> GcsTrainingInput
fn clone(&self) -> GcsTrainingInput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more