Class: Transformers::SquadFeatures

Inherits:
Object
  • Object
show all
Defined in:
lib/transformers/data/processors/squad.rb

Instance Method Summary collapse

Constructor Details

#initialize(input_ids:, attention_mask:, token_type_ids:, cls_index:, p_mask:, example_index:, unique_id:, paragraph_len:, token_is_max_context:, tokens:, token_to_orig_map:, start_position:, end_position:, is_impossible:, qas_id: nil, encoding: nil) ⇒ SquadFeatures

Returns a new instance of SquadFeatures.



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
# File 'lib/transformers/data/processors/squad.rb', line 76

def initialize(
  input_ids:,
  attention_mask:,
  token_type_ids:,
  cls_index:,
  p_mask:,
  example_index:,
  unique_id:,
  paragraph_len:,
  token_is_max_context:,
  tokens:,
  token_to_orig_map:,
  start_position:,
  end_position:,
  is_impossible:,
  qas_id: nil,
  encoding: nil
)
  @input_ids = input_ids
  @attention_mask = attention_mask
  @token_type_ids = token_type_ids
  @cls_index = cls_index
  @p_mask = p_mask

  @example_index = example_index
  @unique_id = unique_id
  @paragraph_len = paragraph_len
  @token_is_max_context = token_is_max_context
  @tokens = tokens
  @token_to_orig_map = token_to_orig_map

  @start_position = start_position
  @end_position = end_position
  @is_impossible = is_impossible
  @qas_id = qas_id

  @encoding = encoding
end