File: autofill_field_classification_model_metadata.proto

package info (click to toggle)
chromium 140.0.7339.127-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,192,880 kB
  • sloc: cpp: 35,093,808; ansic: 7,161,670; javascript: 4,199,694; python: 1,441,797; asm: 949,904; xml: 747,503; pascal: 187,748; perl: 88,691; sh: 88,248; objc: 79,953; sql: 52,714; cs: 44,599; fortran: 24,137; makefile: 22,114; tcl: 15,277; php: 13,980; yacc: 9,000; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (132 lines) | stat: -rw-r--r-- 4,787 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

edition = "2023";

package optimization_guide.proto;

option optimize_for = LITE_RUNTIME;
option java_package = "org.chromium.components.optimization_guide.proto";
option java_outer_classname = "AutofillFieldClassificationModelMetadata";

message AutofillFieldClassificationEncodingParameters {
  // Per-field features that can be included in the model input.
  enum AutofillFieldClassificationFeature {
    // Don't use.
    FEATURE_UNKNOWN = 0;

    // The label of the field.
    FEATURE_LABEL = 1;

    // The placeholder in the field.
    FEATURE_PLACEHOLDER = 2;

    // The autocomplete attribute of the field.
    FEATURE_AUTOCOMPLETE = 3;

    // The id attribute of the field.
    FEATURE_ID = 4;

    // The name attribute of the field (not FormFieldData::name() which falls
    // back to the id attribute if the name attribute does not exist).
    FEATURE_NAME = 5;

    // The form control type attribute of the field.
    FEATURE_TYPE = 6;
  }

  // Per-form features that can be included in the model input.
  enum AutofillFieldClassificationFormLevelFeature {
    // Don't use.
    FORM_FEATURE_UNKNOWN = 0;

    // The titles of <button> and <submit> elements in a form containing the
    // field.
    FEATURE_FORM_BUTTON_TITLES = 1;

    // The id attribute of a form containing the field.
    FEATURE_FORM_ID = 2;

    // The name attribute of a form containing the field.
    FEATURE_FORM_NAME = 3;

    // The URL path of the frame containing the field.
    FEATURE_FRAME_URL_PATH = 4;
  }

  // Maximum number of form fields for which the model can predict types.
  // When calling the executor with a larger form, predictions are only returned
  // for the first `maximum_number_of_fields` many fields.
  int32 maximum_number_of_fields = 1 [features.field_presence = IMPLICIT];

  // Max tokens per field per feature.
  int32 max_tokens_per_feature = 2 [features.field_presence = IMPLICIT];

  // The per-field features provided to the model in the order they are
  // presented to the model.
  repeated AutofillFieldClassificationFeature features = 3;

  // Pre-processing of feature strings:
  // labels, name, id attributes, etc. are preprocessed by the following steps:

  // Split a camelCase or UpperCamelCase string into separate words with
  // spaces in between.
  bool split_on_camel_case = 4 [features.field_presence = IMPLICIT];

  // If true, map the string to lowercase.
  bool lowercase = 5 [features.field_presence = IMPLICIT];

  // Replace all characters listed in `replace_chars_with_whitespace` with a
  // single space. If empty, this step is skipped.
  string replace_chars_with_whitespace = 6 [features.field_presence = IMPLICIT];

  // Replace all characters listed in `remove_chars` with the empty string.
  // If empty, this step is skipped.
  string remove_chars = 7 [features.field_presence = IMPLICIT];

  // The per-form features provided to the model in the order they are presented
  // to the model.
  repeated AutofillFieldClassificationFormLevelFeature form_features = 8;
}

message AutofillFieldClassificationPostprocessingParameters {
  // If set, types are only assigned to fields that have predictions
  // with at least the specified minimum confidence.
  float confidence_threshold_per_field = 1;

  // If set, the model returns predictions only if *all* fields have predictions
  // with at least the specified minimum confidence.
  float confidence_threshold_to_disable_all_predictions = 2;

  // If true, the model is not allowed to return the same prediction for
  // multiple fields in the form.
  bool disallow_same_type_predictions = 3;
}

// Metadata for OPTIMIZATION_TARGET_AUTOFILL_FIELD_CLASSIFICATION.
message AutofillFieldClassificationModelMetadata {
  // The dictionary used for vectorization of the input labels. The strings
  // are mapped to integers in the order that they are present in the repeated
  // field. Index 0 of `input_token` maps to integer 2, since 0 is reserved for
  // padding and 1 is reserved for unknown tokens.
  repeated string input_token = 1;

  // The mapping from the model's outputs to the (integer representation of) the
  // corresponding `autofill::FieldType`.
  repeated fixed32 output_type = 2;

  // Deprecated in M132.
  reserved 3;

  // The version of the input, based on which the relevant model
  // version will be used from server.
  int64 input_version = 4;

  // Encoding parameters, used for input versions >= 3.
  AutofillFieldClassificationEncodingParameters encoding_parameters = 5;

  // Output processing parameters.
  AutofillFieldClassificationPostprocessingParameters
      postprocessing_parameters = 6;
}