Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/NUSTM/VLP-MABSA
/ functions
Functions
191 in github.com/NUSTM/VLP-MABSA
⨍
Functions
191
◇
Types & classes
41
↳
Endpoints
1
Method
__init__
( self, input_dim, inner_dim, num_classes, pooler_
src/model/modeling_bart.py:842
Method
__init__
(self, num_embeddings: int, embedding_dim: int, padding_idx: int, offset)
src/model/modeling_bart.py:870
Method
__init__
(self, num_embeddings: int, embedding_dim: int, padding_idx
src/model/modeling_bart.py:903
Method
__init__
(self, num_embeddings: int, embedding_dim: int, padding_idx
src/model/modeling_bart.py:985
Method
__init__
(self, config: BartConfig)
src/model/modeling_bart.py:1095
Method
__init__
(self, config: BartConfig)
src/model/modeling_bart.py:1224
Method
__init__
(self, config: BartConfig, **kwargs)
src/model/modeling_bart.py:1410
Method
__init__
(self, config)
src/model/modeling_bart.py:1500
Method
__init__
(self, num_positions, embedding_dim, padding_idx=None)
src/model/modeling_bart.py:1605
Method
__init__
(self, eos_token_id, num_labels, conflict_id,
src/model/metrics.py:7
Method
__init__
(self, image_dim, final_dim)
src/model/modules.py:23
Method
__init__
(self, config: MultiModalBartConfig, encoder, img_feat_id, cls_token_id)
src/model/modules.py:55
Method
__init__
(self, config: MultiModalBartConfig, tokenizer, decoder,
src/model/modules.py:173
Method
__init__
(self, config: MultiModalBartConfig, decoder)
src/model/modules.py:339
Method
__init__
(self, config: MultiModalBartConfig, decoder)
src/model/modules.py:381
Method
__init__
(self, config: MultiModalBartConfig, decoder, senti_ids,
src/model/modules.py:425
Method
__init__
(self, config: MultiModalBartConfig, decoder, causal_mask, args)
src/model/modules.py:468
Method
__init__
:param Seq2SeqModel seq2seq_model: 序列到序列模型. 会使用seq2seq_model的decoder进行生成 :param int,None bos_token_id: 句子开头的token id :param
src/model/generater.py:17
Method
__init__
:param Seq2SeqDecoder decoder: Decoder对象 :param int max_length: 生成句子的最大长度, 每句话的decode长度为max_length + max_len_a*src_len :para
src/model/generater.py:123
Method
__init__
(self, config: MultiModalBartConfig, args, bart_model, tokenizer, label_ids)
src/model/MAESC_model.py:72
Method
__init__
(self, config: MultiModalBartConfig, bart_model, tokenizer, label_ids, senti_ids, args)
src/model/model.py:80
Method
__init__
(self, args, pretrained_model_name='facebook/bart-base', cl
src/data/tokenization_new.py:20
Method
__init__
(self, infos)
src/data/dataset.py:13
Method
__init__
(self, infos, split)
src/data/dataset.py:125
Method
__init__
:param tokenizer: ConditionTokenizer :param mlm_enabled: bool, if use mlm for language modeling. False for autoregressive modeling
src/data/collation.py:14
Method
__len__
Number of hypotheses in the list.
src/model/generater.py:759
Method
__len__
(self)
src/data/tokenization_new.py:676
Method
__len__
(self)
src/data/dataset.py:34
Method
__len__
(self)
src/data/dataset.py:143
Function
_check_shapes
(shape_1, shape2)
src/model/modeling_bart.py:206
Method
_clip_text
(self, text, length)
src/data/collation.py:69
Function
_get_shape
(t)
src/model/modeling_bart.py:1086
Method
_init_weights
(self, module)
src/model/modules.py:439
Method
_reorder_cache
(past, beam_idx)
src/model/modeling_bart.py:1387
Method
_reorder_cache
(past, beam_idx)
src/model/mixins.py:420
Method
adjust_logits_during_generation
(self, logits, cur_len, max_length)
src/model/modeling_bart.py:1374
Method
adjust_logits_during_generation
(self, logits, cur_len, max_length)
src/model/mixins.py:400
Function
clip_gradient
(optimizer, grad_clip)
src/model/utils.py:16
Function
cmp
(v1, v2)
src/data/tokenization_new.py:9
Method
convert_ids_to_tokens
(self, ids)
src/data/tokenization_new.py:670
Method
dummy_inputs
(self)
src/model/modeling_bart.py:187
Method
encode_anp_dis
(self, batch_size)
src/data/tokenization_new.py:336
Method
encode_mlm_sentence
(self, labels)
src/data/tokenization_new.py:173
Function
eval
(args, model, loader, metric, device)
src/eval_utils.py:5
Method
evaluate
(self, aesc_target_span, pred, tgt_tokens)
src/model/metrics.py:34
Method
forward
Args: x (Tensor): input to the layer of shape `(seq_len, batch, embed_dim)` encoder_padding_mask (ByteTensor): binary
src/model/modeling_bart.py:248
Method
forward
Args: input_ids (LongTensor): tokens in the source language of shape `(batch, src_len)` attention_mas
src/model/modeling_bart.py:327
Method
forward
( self, x, encoder_hidden_states, encoder_attn_mask=None,
src/model/modeling_bart.py:426
Method
forward
Includes several features from "Jointly Learning to Align and Translate with Transformer Models" (Garg et al., EMNLP 2019).
src/model/modeling_bart.py:541
Method
forward
(self, x)
src/model/modeling_bart.py:854
Method
forward
Input is expected to be of size [bsz x seqlen].
src/model/modeling_bart.py:881
Method
forward
Input is expected to be of size [bsz x seqlen].
src/model/modeling_bart.py:919
Method
forward
Input is expected to be of size [bsz x seqlen].
src/model/modeling_bart.py:1001
Method
forward
( self, input_ids, attention_mask=None, decoder_input_ids=None
src/model/modeling_bart.py:1113
Method
forward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`, `optional`): Labels for computing the masked l
src/model/modeling_bart.py:1253
Method
forward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`): Labels for computing the sequence classification/
src/model/modeling_bart.py:1429
Method
forward
r""" start_positions (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`): Labels for position (index) of the start
src/model/modeling_bart.py:1518
Method
forward
Input is expected to be of size [bsz x seqlen].
src/model/modeling_bart.py:1629
Method
forward
(self, image_features)
src/model/modules.py:27
Method
forward
:param input_ids: LongTensor, tokens in the source language of shape (batch, src_len) :param image_features: list[FloatTensor], imag
src/model/modules.py:98
Method
forward
(self, tokens, state, only_sc=False)
src/model/modules.py:208
Method
forward
(self, labels, input_ids, encoder_outputs, attention_mask, decoder_input_ids, decoder_attentio
src/model/modules.py:347
Method
forward
(self, labels, input_ids, encoder_outputs, attention_mask, decoder_input_ids, decoder_attentio
src/model/modules.py:389
Method
forward
(self, senti_labels, encoder_outputs, attention_mask, senti_decoder_input_ids)
src/model/modules.py:444
Method
forward
(self, mrm_labels, mrm_masks, encoder_outputs, attention_mask, mrm_decoder_input_ids, mrm_deco
src/model/modules.py:489
Method
forward
透传调用seq2seq_model的forward :param torch.LongTensor src_tokens: bsz x max_len :param torch.LongTensor tgt_tokens: bsz x max_le
src/model/generater.py:64
Method
forward
( self, input_ids, image_features, attention_mask=None,
src/model/MAESC_model.py:124
Method
forward
( self, task_type, input_ids, image_features, atte
src/model/model.py:125
Method
generate
Generates sequences for models with a LM head. The method currently supports greedy decoding, beam-search decoding, sampling with tem
src/model/mixins.py:33
Method
get_encoder
(self)
src/model/modeling_bart.py:1398
Method
get_input_embeddings
(self)
src/model/modeling_bart.py:1203
Function
get_lr
(optimizer)
src/model/utils.py:11
Method
get_metric
(self, reset=True)
src/model/metrics.py:140
Method
get_output_embeddings
(self)
src/model/modeling_bart.py:1211
Method
get_output_embeddings
(self)
src/model/modeling_bart.py:1401
Method
get_output_embeddings
(self)
src/model/mixins.py:439
Function
greedy_generate
贪婪地搜索句子 :param Decoder decoder: Decoder对象 :param torch.LongTensor tokens: batch_size x len, decode的输入值,如果为None,则自动从bos_token_id开始生成
src/model/generater.py:223
Method
line
(self)
src/utils.py:55
Function
liner_warmup
(cur_step, t_step, warmup)
src/model/utils.py:25
Function
load_training_data
(path, optimizer=None, scaler=None, map_location=None)
src/utils.py:30
Method
prepare_inputs_for_generation
(self, decoder_input_ids, past, attention_mask, use_cache,
src/model/modeling_bart.py:1360
Method
prepare_inputs_for_generation
(self, decoder_input_ids, past, attention_mask, use_cache, **kwargs)
src/model/mixins.py:386
Method
pri
(self)
src/model/metrics.py:136
Method
reorder_state
(self, indices: torch.LongTensor)
src/model/MAESC_model.py:158
Method
resize_token_embeddings
(self, new_num_tokens: int)
src/model/modeling_bart.py:1232
Function
sample_sentence
(model, input_ids, image_features, attention_mask,
src/model/utils.py:32
Method
set_input_embeddings
(self, value)
src/model/modeling_bart.py:1206
Function
set_lr
(optimizer, lr)
src/model/utils.py:6
Method
set_new_generator
(self, max_length=-1, max_len_a=-1,
src/model/generater.py:176
Method
set_position_embedding
(self, special_tag_start_id, tag_first=True)
src/model/modeling_bart.py:526
Function
setup_process
(rank, world_size, master_port='12355')
src/utils.py:9
← previous
101–191 of 191, ranked by callers