Giter VIP home page Giter VIP logo

neuronblocks's Introduction

Building Your NLP DNN Models Like Playing Lego

language python pytorch license

简体中文

Tutorial 中文教程 Demo Video

Table of Contents

Overview

NeuronBlocks is a NLP deep learning modeling toolkit that helps engineers/researchers to build end-to-end pipelines for neural network model training for NLP tasks. The main goal of this toolkit is to minimize developing cost for NLP deep neural network model building, including both training and inference stages.

NeuronBlocks consists of two major components: Block Zoo and Model Zoo.

  • In Block Zoo, we provide commonly used neural network components as building blocks for model architecture design.
  • In Model Zoo, we provide a suite of NLP models for common NLP tasks, in the form of JSON configuration files.

Language Supported

  • English
  • Chinese

NLP Tasks Supported

  • Sentence Classification
  • Sentiment Analysis
  • Question Answering Matching
  • Textual Entailment
  • Slot tagging
  • Machine Reading Comprehension
  • Knowledge Distillation for Model Compression
  • More on-going

Toolkit Usage

Users can either pick existing models (config files) in Model Zoo to start model training or create new models by leveraging neural network blocks in Block Zoo just like playing with Lego.

Get Started in 60 Seconds

Installation

Note: NeuronBlocks requires Python 3.6 and above.

  1. Clone this project.

    git clone https://github.com/Microsoft/NeuronBlocks
  2. Install Python packages in requirements.txt by the following command.

    pip install -r requirements.txt
  3. Install PyTorch (NeuronBlocks supports PyTorch 0.4.1 and above).

    For Linux, run the following command:

    pip install "torch>=0.4.1"

    For Windows, we suggest you to install PyTorch via Conda by following the instruction of PyTorch.

Quick Start

Get started by trying the given examples. Both Linux/Windows, GPU/CPU are supported. For Windows, we suggest you to use PowerShell instead of CMD.

Tips: in the following instruction, PROJECTROOT denotes the root directory of this project.

# train
cd PROJECT_ROOT
python train.py --conf_path=model_zoo/demo/conf.json

# test
python test.py --conf_path=model_zoo/demo/conf.json

# predict
python predict.py --conf_path=model_zoo/demo/conf.json

For prediction, NeuronBlocks have two modes: Interactive and Batch.

  • Interactive Prediction Mode: The interactive mode provides interactive interface, users can input case according to corresponding prompt message and get realtime prediction result from trained model, and input "exit" to exit interactive interface.
# use the above example
# interactive prediction
python predict.py --conf_path=model_zoo/demo/conf.json --predict_mode='interactive'
  • Batch Prediction Mode: For batched cases prediction, NeuronBlocks provides batch prediction mode which receives a cases file as input and write the prediction results in the prediction file.
# use the above example
# batch prediction
python predict.py --conf_path=model_zoo/demo/conf.json --predict_mode='batch' --predict_data_path=dataset/demo/predict.tsv

For more details, please refer to Tutorial.md and Code documentation.

Who should consider using NeuronBlocks

Engineers or researchers who face the following challenges when using neural network models to address NLP problems:

  • Many frameworks to choose and high framework studying cost.
  • Heavy coding cost. A lot of details make it hard to debug.
  • Fast Model Architecture Evolution. It is difficult for engineers to understand the mathematical principles behind them.
  • Model Code optimization requires deep expertise.
  • Model Platform Compatibility Requirement. It requires extra coding work for the model to run on different platforms, such as Linux/Windows, GPU/CPU.

The advantages of leveraging NeuronBlocks for NLP neural network model training includes:

  • Model Building: for model building and parameter tuning, users only need to write simple JSON config files, which greatly minimize the effort of implementing new ideas.

  • Model Sharing It is super easy to share models just through JSON files, instead of nasty codes. For different models or tasks, our users only need to maintain one single centralized source code base.

  • Code Reusability: Common blocks can be easily shared across various models or tasks, reducing duplicate coding work.

  • Platform Flexibility: NeuronBlocks can run both on Linux and Windows machines, using both CPU and GPU. It also supports training on GPU platforms like Philly and PAI.

    CPU inferenceSingle-GPU inferenceMulti-GPU inference
    CPU train
    Single-GPU train
    Multi-GPU train
  • Model Visualization: A model visualizer is provided for visualization and configure correctness checking, which helps users to visualize the model architecture easily during debugging.

  • Extensibility: NeuronBlocks is extensible, allowing users to contribute new blocks or contributing novel models (JSON files).

Contribute

NeuronBlocks operates in an open model. It is designed and developed by STCA NLP Group, Microsoft. Contributions from academia and industry are also highly welcome. For more details, please refer to Contributing.md.

Ongoing Work and Call for Contributions

Anyone who are familiar with are highly encouraged to contribute code.

  • Knowledge Distillation for Model Compression. Knowledge distillation for heavy models such as BERT, OpenAI Transformer. Teacher-Student based knowledge distillation is one common method for model compression.
  • Multi-Lingual Support
  • NER Model Support
  • Multi-Task Training Support

Reference

NeuronBlocks -- Building Your NLP DNN Models Like Playing Lego. EMNLP 2019, at https://arxiv.org/abs/1904.09535.

@article{gong2019neuronblocks,
  title={NeuronBlocks--Building Your NLP DNN Models Like Playing Lego},
  author={Gong, Ming and Shou, Linjun and Lin, Wutao and Sang, Zhijie and Yan, Quanjia and Yang, Ze, Cheng, Feixiang and Jiang, Daxin},
  journal={arXiv preprint arXiv:1904.09535},
  year={2019}
}

Related Project

  • OpenPAI is an open source platform that provides complete AI model training and resource management capabilities, it is easy to extend and supports on-premise, cloud and hybrid environments in various scale.
  • Samples for AI:  a deep learning samples and projects collection. It contains a lot of classic deep learning algorithms and applications with different frameworks, which is a good entry for the beginners to get started with deep learning.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License.

Contact

If you have any questions, please contact [email protected]

If you have wechat, you can also add the following account:

neuronblocks's People

Contributors

adolphk-yk avatar bharatr21 avatar boshining avatar chengfx avatar ericwtlin avatar fareise avatar ljshou avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar woailaosang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neuronblocks's Issues

add a demo script

similar to pytext --config-file demo/configs/docnn.json predict <<< '{"raw_text": "create an alarm for 1:30 pm"}'

Project dependencies may have API risk issues

Hi, In NeuronBlocks, inappropriate dependency versioning constraints can cause risks.

Below are the dependencies and version constraints that the project is using

nltk==3.4.1
gensim==3.7.2
tqdm==4.31.1
numpy==1.16.3
scikit-learn==0.20.3
ftfy==5.5.1
jieba==0.39

The version constraint == will introduce the risk of dependency conflicts because the scope of dependencies is too strict.
The version constraint No Upper Bound and * will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs.

After further analysis, in this project,
The version constraint of dependency nltk can be changed to >=3.2.3,<=3.7.
The version constraint of dependency gensim can be changed to >=3.0.0,<=3.1.0.
The version constraint of dependency gensim can be changed to >=4.0.0,<=4.2.0.
The version constraint of dependency tqdm can be changed to >=4.36.0,<=4.64.0.
The version constraint of dependency scikit-learn can be changed to >=0.15.0,<=0.20.4.
The version constraint of dependency jieba can be changed to >=0.36,<=0.36.2.

The above modification suggestions can reduce the dependency conflicts as much as possible,
and introduce the latest version as much as possible without calling Error in the projects.

The invocation of the current project includes all the following methods.

The calling methods from the nltk
collections.OrderedDict
nltk.tokenize.util.align_tokens
nltk.tag.perceptron.PerceptronTagger
nltk.download
The calling methods from the gensim
gensim.models.keyedvectors.KeyedVectors.load_word2vec_format
gensim.models.fasttext.FastText.load_fasttext_format
The calling methods from the tqdm
tqdm.tqdm
The calling methods from the scikit-learn
sklearn.metrics.f1_score
sklearn.metrics.roc_auc_score
sklearn.metrics.recall_score
random.choice
sklearn.metrics.mean_squared_error
sklearn.metrics.precision_score
sklearn.metrics.accuracy_score
sklearn.metrics.auc
sklearn.metrics.roc_curve
The calling methods from the jieba
jieba.setLogLevel
jieba.cut
The calling methods from the all methods
self.Pooling2DConf.super.__init__
self.Conf.load_data.check_conf
string.contiguous.view
i.line_split.split
self._merge_encode_data.values
f.split
string2.unsqueeze
print
y_mask.unsqueeze.expand
self.model.update_use_gpu
self.ElementWisedMultiply2DConf.super.inference
self.conv
conf.optimizer_name.eval
logits_softmax.cpu.data.numpy
self.conf.answer_column_name.i.length_batches.numpy
former_conf.type.str.lower
self.batch_norm
self.CRFConf.super.verify
self.target_dict.get
self.conf.answer_column_name.i.target_batches.reshape
self.BiLSTMLastConf.super.verify
single_input_cluster.input_cluster.length_batch.append
ModelConf.ModelConf
diff_metric.split
os.path.isfile
losses.BaseLossConf.BaseLossConf.get_conf
torch.nn.utils.rnn.pack_padded_sequence
self.BiLSTMAttConf.super.inference
masks.torch.stack.view
codecs.open.close
self.Concat2D.super.__init__
self.Conv2DConf.super.__init__
exceptions.ConfigurationError
query.unsqueeze
self.Transformer.super.__init__
self.merge_heads
self.DBC2SBC
vec.max_score.expand_as.vec.torch.exp.torch.sum.torch.log.view
self.FullAttentionConf.super.inference
torch.autograd.Variable
torch.nn.BatchNorm1d
self.get_encode_generator
torch.cat
distribution.append
self.dropout.cuda
logging.error
convert_to_tmppath
core.LRScheduler.LRScheduler.get_lr
torch.index_select
self.LinearConf.super.inference
string2_len.cpu.numpy.max
self.is_cuda
self.EmbeddingConf.super.__init__
queue.Queue.get
input_cluster.self.embeddings.parameters
layer_name.eval
pointer.contiguous.view
slot_tagging_metrics.get_ner_BIO
tag_size.batch_size.torch.zeros.autograd.Variable.long
e_idx.view.s_idx.torch.gather.squeeze
self.BiLSTM.super.__init__
text_lines.append
enumerate
e_idx.view
layer_arch.get
self.HighwayLinearConf.super.verify
line.split.split
self.MLPConf.super.__init__
self.PoolingConf.super.verify
utils.common_utils.get_trainable_param_num
item.keys
lr_total.append
str
self.BiLSTMAttConf.super.verify
encoder_outputs.size
Cache.check
string_output.transpose.transpose
self.text_preprocessor.preprocess
temp_target_batch.append
self.use_parent_doc
self._score_sentence
self.alpha.type
self.download_or_zip
self.MLP.super.__init__
torch.nn.AvgPool2d
repr
torch.nn.Linear
logging.StreamHandler.setFormatter
open.write
logits_flat.detach.cpu
ConfigurationError
self.InteractionConf.super.__init__
torch.zeros
field.find
json.dumps
text.translate.split
Cache.back_up
json.keys
self.c_fc
torch.gather.contiguous
temp_logits_flat.detach.cpu.numpy
collections.defaultdict.values
self.layer_conf.START_TAG.self.layer_conf.target_dict.inivalues.clone.view
numpy.ones
self.BiLSTMAttConf.super.verify_before_inference
field.split
torch.no_grad
core.StreamingRecorder.StreamingRecorder.clear_records
tag_seq.cpu.numpy
self.output_dim.append
load_embedding
self.Minus3DConf.super.verify
layer_conf.mlp_name.eval
torch.nn.MaxPool2d
seq_len.cpu.numpy.max
self.encoder_conf_cls.verify
get_conf
self.input_dicts.cell_num
torch.sqrt.mean
Cache.load
j.get
batch_size.mask.long.torch.sum.view.long
Digraph.render
self.evaluator.compare
self.Expand_plusConf.super.verify
char_hidden.transpose.contiguous.view
transferer.pkl_dump
answers.append
os.remove
_.lower
file_index.append
jieba.cut
single_loss_fn
target.view.view
Y.view.view
self.cnn
os.path.exists
input_cluster.self.char_embeddings
Digraph.attr
tmp_docs.items
torch.matmul
time.sleep
self.model.module.layers.get_parameters
torch.nn.GRU
EnglishTokenizer
torch.cat.append
self._prepare_encoding_cache
self.dropout
results.keys
list.cpu
web.application
sys.argv.upper
filepath.replace.startswith
self.EncoderDecoderConf.super.verify_before_inference
self.SLUEncoder.super.__init__
os.path.dirname
self.change_to_list
type
string.shape.string.shape.masks.torch.stack.view.expand_as
self.metrics_post_check.add
argparse.ArgumentParser.parse_known_args
sys.path.append
self.problem.encode_data_list
self.vars.items
all
utils.BPEEncoder.BPEEncoder.encode
core.ChineseTokenizer.ChineseTokenizer
string.index_select.size
string.view
field_to_chk.split
numpy.array
X.detach
self.MatrixMultiplyConf.super.__init__
all_losses.append
globals
logits_flat.detach.cpu.numpy
problem.output_dict.has_cell
countChunks
core.StreamingRecorder.StreamingRecorder.record
range.extend
text.translate.lower
input.contiguous.view
color.get
logpt.view.view
kwargs.eval
k.q.torch.matmul.to
scores.view
all_output.append
string1_HoW.size
layer_conf.decoder_name.eval
self.Linear.super.__init__
self.CRFConf.super.__init__
result_conll.append
self.CRF.super.__init__
core.StreamingRecorder.StreamingRecorder
string_len.unsqueeze.expand_as
torch.nn.ModuleDict
torch.gather
torch.nn.Parameter
self.delete_example
self.Add3DConf.super.inference
self.evaluate
self.get_supported_metrics
self.FullAttentionConf.super.verify
sklearn.metrics.roc_curve
torch.mm
self.cell
single_type.dest_dict.extend
self.linear_final.expand_as
set.add
self._merge_encode_lengths.numpy
BIO2BIOES
string.permute.contiguous
idx.view
ChineseTokenizer.span_tokenize
text.split
sum
multiprocessing.cpu_count
self.c_proj
self.split_heads
self.CRFLoss.super.__init__
value.export_cell_dict
content.unsqueeze.expand
layer_name.eval.verify
self.input_dicts.build
query_aug.contiguous.view.contiguous
self.ConvPoolingConf.super.verify
list.append
string_aug.contiguous.view
feats.transpose.contiguous
f.read
data_batches.keys
self.layer_conf.resid_dropout.nn.Dropout
numpy.sort
isinstance
partition.contiguous.view
self.decoder_conf_cls.verify_before_inference
self.BilinearAttentionConf.super.__init__
IOB2BIO
self.layernorm2_conf_cls.inference
numpy.min
core.LRScheduler.LRScheduler.step
stand_matrix.append
self.layer_conf.hidden_dim.string2.size.string2_key.view.transpose.contiguous
queue.Queue.qsize
target_docs.values
Model.Model
self.ConvPoolingConf.super.inference
key.docs.extend
self.softmax
get_pairs
self.loss_fn.append
self._merge_encode_data
shutil.rmtree
self._merge_encode_data.pop
format
string_out.permute.contiguous
lm.model.parameters
string1_HoW.contiguous
min
i.label_list.upper
torch.tril
func_get_value_by_key
string.unsqueeze
os.listdir
torch.sigmoid
evaluator.get_first_metric_result
QRNNLayer
layer.chunk
self.layer_conf.hidden_dim.string.size.torch.FloatTensor.zero_
self.char_embeddings.cuda
string.size.real_context.torch.cat.view.unsqueeze
p1.ls.unsqueeze.max
self.HighwayLinearConf.super.__init__
new_tags.transpose.contiguous.view.cuda
tag_size.tag_size.self.transitions.view.expand
self.dataset_type.lower
self.normalize_answer
utils.exceptions.LayerDefineError
exit
results.append
join.append
layer_conf.encoder_name.eval
input_type.lower
list.items
query.size
self.Add2DConf.super.verify
hidden.size.hidden.view.unsqueeze.size
single_type.target_docs.extend
logging.debug
self.Add3DConf.super.verify
self.layer_conf.hidden_dim.string1.size.string1_key.view.transpose.contiguous
metric.find
ConstantStaticItems.add_item
hidden.energies.bmm.transpose
CNNCharEmbedding
nltk.corpus.stopwords.words
next_hidden.torch.cat.view
torch.Tensor
h.view.size
self.DropoutConf.super.__init__
self.SLUDecoderConf.super.__init__
self.InteractionConf.super.verify
back_points.torch.cat.view
self._check_bpe_encoder
self.MatrixMultiplyConf.super.varify
self.BiGRUConf.super.verify
shutil.copy
LearningMachine.LearningMachine
gensim.models.fasttext.FastText.load_fasttext_format
utils.common_utils.transform_tensors2params
self.CombinationConf.super.inference
configurate_data_format
self.Pooling1D.super.__init__
self.MatchAttention.super.__init__
self.tokenize
utils.common_utils.prepare_dir
dict
attention.torch.max.F.softmax.unsqueeze
self.BiLSTMAttConf.super.__init__
transferer.torch_save
last_position.partition_history.torch.gather.view
hidden.size.hidden.view.unsqueeze
logging.basicConfig
self.AttentionConf.super.__init__
branch.problem.input_dicts.id
utils.common_utils.dump_to_json
batch_size.mask.long.torch.sum.view.long.view
multiprocessing.Pool
problem.Problem.build_encode_cache
self.ConvPoolingConf.super.__init__
i.aligns.unsqueeze
x.bmm.size
loss_fn.loss_fn
logging.Formatter
calculate_AUC.main
self.add_attr_value_assertion
idx_unsort.string_output.index_select.contiguous
tuple.extend
key_random.i.length_batches.numpy
self.language.lower
pickle.load
input_cluster.layer_conf.conf.eval.verify
self.MatchAttentionConf.super.verify
self.decoder_conf_cls.inference
list.size
ChineseTokenizer
string2_rep.transpose.string1_rep.bmm.view
self.BilinearAttention.super.__init__
key.split
NewsGroup.data_combination
self.InteractionConf.super.inference
read_tsv
scores.size
block
single_input_type.type2cluster.self.input_dicts.id
line.strip
fin.readline
string2.unsqueeze.expand
length_batches.keys.list.remove
argparse.ArgumentParser
string.transpose.transpose
input.input_cluster.self.embeddings.float
self.add_attr_exist_assertion_for_dev
self.MultiHeadAttention.super.__init__
self.cell_doc_count.most_common
input.self.input_dicts.cell_num
self.LayerNormConf.super.verify
self.input_word_dict.cell_num
utils.corpus_utils.get_batches
item.load_data
metrics.Evaluator.Evaluator
self.char_cnn.append
AttributeError
self.conf.answer_column_name.i.target_batches.numpy
sklearn.metrics.precision_score
tag_size.batch_size.partition.contiguous.view.expand
input.contiguous.view.view
target.values
alphas.bmm.matmul
batch_size.idx.mask.view.expand
self.BiAttFlow.super.__init__
args.size.torch.zeros.to
string2_mask.to.to
nltk.tokenize.util.align_tokens
logits_softmax.data.max
self.CombinationConf.super.__init__
list
log_sum_exp.masked_select
tag_size.crf_layer_conf.STOP_TAG.crf_layer_conf.target_dict.transitions.contiguous.view.expand
encoder_outputs.contiguous
torch.from_numpy
X.size
self.loss_input.append
ord
self._calculate_forward
h.view.view
json.loads
write_file
y.size
new_labels.append
self.BiAttFlowConf.super.__init__
self.BiQRNN.super.__init__
self.add_dependency
self.SLUEncoderConf.super.inference
idx_sort.sort
single_mrc_metric.lower
outputs.append
attn_energies.squeeze.masked_fill
torch.tensor
self.EncoderDecoder.super.__init__
utils.corpus_utils.load_embedding.keys
get_block_path
self.problem.output_dict.id
content.b.torch.bmm.squeeze
problem.output_dict.cell_num
all_costs.append
numpy.sqrt
self.model.layers.get_parameters
ftfy.fix_text
torch.tanh
torch.nn.functional.dropout
loss_fn.item
real_context.torch.cat.view
functools.wraps
self.ElementWisedMultiply2DConf.super.__init__
word_dict.iteritems
self.Expand_plusConf.super.__init__
self.char_embeddings
loss_fn
input_cluster.conf.input_types.items
fout.write
self.SLUDecoderConf.super.verify
self.BiLSTMConf.super.verify
numpy.mean
open.close
branch.dest_dict.extend
self.MLPConf.super.inference
get_layer
self.PoolingConf.super.__init__
alphas.bmm.transpose
line.strip.split
logits_softmax.detach.max
self.ConvConf.super.verify
self.Conf.load_data
decode.append
decode_idx.transpose.cuda
get_block_path.split
self.c_attn.split
collections.defaultdict
utils.common_utils.dump_to_pkl
self.Loss.super.__init__
illegal_metrics.append
string2.size
self.Concat2DConf.super.__init__
logits_softmax.data.max.cpu.numpy
self.BiQRNNConf.super.inference
self.linear_in
torch.pow
diff_field.startswith
features.append
collections.Counter
self.LayerNormConf.super.inference
device.float.c_len.c_len.torch.ones.to.tril.unsqueeze.expand
torch.nn.functional.softmax.view
core.EnglishTokenizer.EnglishTokenizer
single_input_type.type2cluster.self.input_dicts.lookup
os.path.abspath
fout.writelines
max
self.Minus2DConf.super.verify
input.lower
self.dropout_layer
string1_HoW.contiguous.view
queue.Queue.empty
self.output_dict.update
torch.nn.Sequential
self.Concat3DConf.super.verify
string_len_out.to.to
range.tolist
torch.cuda.is_available
hashlib.md5.hexdigest
string_len.torch.FloatTensor.unsqueeze
calcMetrics
sklearn.metrics.accuracy_score
x.bmm
layer_conf.layernorm2_name.eval
mask.long
emb.to.to
self.LinearAttentionConf.super.verify_before_inference
p.numel
self.LinearAttention.super.__init__
x.f.split
open
multiprocessing.Pool.apply_async
name.self.getattr.load_cell_dict
utils.common_utils.log_set
string_out.transpose.contiguous
join.split
self.HighwayLinear.super.__init__
self._merge_target
utils.corpus_utils.get_seq_mask
self.BiGRULastConf.super.verify_before_inference
self.output_dim.pop
self.activation.bmm
chunkTag.split
back_points.transpose.contiguous.append
self.register_buffer
alpha_flat.view.bmm
scores.data.masked_fill_
v.size
string1.size
cls.__dict__.keys
batch_char_pad.append
string.permute.contiguous.permute
parse_args
utils.common_utils.load_from_json
self.attention_dropout
query.unsqueeze.expand
input_params.append
self.mlp_conf_cls.verify
masks.cuda.append
self.tokenizer.tokenize
self.FullAttentionConf.super.__init__
self.Pooling1DConf.super.verify
self.AttentionConf.super.inference
line.rstrip.split
self.layer_conf.hidden_dim.string2.size.string2_key.view.transpose.contiguous.view
alphas.bmm.index_select
self.BiGRU.super.__init__
self.Conv2DConf.super.verify_before_inference
self.build_training_multi_processor
self.FullAttentionConf.super.verify_before_inference
sorted
tag_seq.cpu
queue.Queue
self.LSTMCharEmbedding.super.__init__
self.Pooling1DConf.super.__init__
self.bpe
self.BiGRULastConf.super.inference
torch.sqrt
self.output_dim.insert
torch.nn.utils.clip_grad_norm_
test_data_path.endswith
args.size
y.transpose
torch.nn.utils.rnn.pad_packed_sequence
batch_size.length_mask.view.expand
log_sum_exp
self.EmbeddingConf.super.inference
BIOES2BIO
conf.emb_pkl_path.startswith
input.contiguous.view.dim
self.Add3DConf.super.__init__
ValueError
subprocess.check_call
self.BilinearAttentionConf.super.inference
self.BaseLayer.super.__init__
self.EncoderDecoderConf.super.verify
self.GRU.flatten_parameters
logging.StreamHandler
string.shape.string.shape.torch.ones.to
configurate_model_input
input.data.type
torch.stack
self.ConvConf.super.inference
tag_size.ins_num.feats.transpose.contiguous.view.expand.size
self.LinearAttentionConf.super.inference
self.FlattenConf.super.inference
back_points.transpose.contiguous
torch.nn.BatchNorm2d
string.transpose.contiguous
self.input_dicts.update
merge.split
mask.long.byte
string2_mask.data.byte
self.CNNCharEmbeddingConf.super.__init__
super
web.template.render.model_visualizer
EMBED_LAYER_ID.self.layers
hashlib.md5
random.sample
path.startswith
web.form.Textarea
sklearn.metrics.auc
ls
self.Pooling2D.super.__init__
torch.nn.functional.conv2d
self.ElementWisedMultiply2DConf.super.verify
int
encoder_outputs.transpose
self.MLPConf.super.verify
hashlib.md5.update
self.conv.cuda
self.CalculateDistanceConf.super.inference
new_tags.transpose.contiguous.view
self._attn
self.device.string.shape.string.shape.torch.ones.to.torch.tril.view
self.layer_conf.activation.eval
self.CRFConf.super.inference
math.ceil
fin.readline.rstrip.rstrip
torch.sigmoid.size
self.CalculateDistanceConf.super.verify
attention.view.view
loss.mean
self.SLUDecoder.super.__init__
evaluate
layer
layer_arch.input.inputs.input.count
list.detach
text.lower
hasattr
string_len.unsqueeze.unsqueeze
self.layernorm2_conf_cls.verify
self.gelu
diff_metric.find
self.layer_conf.dropout.nn.Dropout
string2_aug.contiguous.view.contiguous
mask.long.byte.long
self.get_supported_metrics.append
nltk.download
self.layer_conf.hidden_dim.string1.size.string1_key.view.transpose
BPEEncoder.bpe
output_labels_list.append
self.DropoutConf.super.inference
bpe_path.open.read.split
self.BilinearAttentionConf.super.verify
main
urllib.request.urlretrieve
nltk.tag.perceptron.PerceptronTagger
string.string_len.expand_as.float
data_batches.append
self.declare
name.self.__recorder.append
numpy.random.uniform
alphas.view.float
i.line_split.lower
string_conv.size.string_conv.F.max_pool1d.squeeze.view
string.float
splitTag
torch.nn.functional.cosine_similarity
logits_softmax.detach.max.cpu.numpy
text_lines.join.replace.replace
decoded.transpose.unsqueeze
self.mthd
single_pred.self.normalize_answer.split
single_cnn
self.MultiHeadAttentionConf.super.__init__
torch.nn.functional.softmax.unsqueeze
self.Conf.load_data.load_from_file
p1.ls.unsqueeze
nltk.word_tokenize
f_r.readlines.strip
tg_energy.masked_select.sum
self.activation.cuda
p1.size
value.squeeze
torch.nn.LSTM
self.activation.permute
mv_form
self.CNNCharEmbedding.super.__init__
self.Conf.load_data.configurate_loss
func
self.BiLSTMConf.super.inference
crf_layer_conf.STOP_TAG.crf_layer_conf.target_dict.transitions.contiguous.view
alpha.unsqueeze.unsqueeze
torch.save
diff_field.find
self.optimizer.keys
utils.philly_utils.open_and_move
string_input.single_cnn.squeeze
input.cpu
input_type.branch.dest_dict.extend
pointer.detach.view
numpy.random.random
fin.read
endOfChunk
self.Match.super.__init__
LearningMachine.LearningMachine.load_model
self.model.train
torch.cat.squeeze
nltk.data.path.append
args.permute
self.Combination.super.__init__
single_conf.lower
optimizer.step
self.Add2D.super.__init__
logits_softmax.detach.max.cpu
tag_list.append
alpha.unsqueeze.bmm
self.Dropout.super.__init__
torch.squeeze
layer_conf.input_dims.i.layer_conf.window_sizes.layer_conf.input_channel_num.layer_conf.output_channel_num.torch.randn.float
problem.Problem.export_problem
padding_mask.torch.from_numpy.byte
self.conf.load_encoding_cache_generator
core.LRScheduler.LRScheduler
ForgetMult
char_hidden.transpose
self.bpe_ranks.get
emb.index_select.index_select
self.tensor_reverse
configurate_data_path
self.activation.view
layer_conf.attention_name.eval
self.get_no_inst
register
self.add_layer
x.size
string2_HoW.size
m_size.idx.view.vec.torch.gather.view.view
single_input_type.branch.data.append
self.check_size
move_from_local_to_hdfs
core.EnglishTextPreprocessor.EnglishTextPreprocessor
next_hidden.torch.cat.view.size
self.SLUEncoderConf.super.verify
set
convert_to_hdfspath
self.BiGRULastConf.super.verify
curr_mrc_metric.append
slot_tagging_metrics.get_ner_BIOES
string_output.index_select.index_select
torch.gather.detach
cur_bp.masked_fill_
self.linear2
scores.view.view
CNNCharEmbeddingConf
key_random.length_batches.numpy
self.ConvConf.super.__init__
i.line_split.strip
utils.common_utils.get_layer_class
judge_dict
output_file.write
core.StreamingRecorder.StreamingRecorder.get
self.c_attn.view
self.CalculateDistanceConf.super.__init__
nltk.tag._pos_tag
sys.exit
input.contiguous.view.transpose
self.LinearAttentionConf.super.__init__
Loss
string2_rep.transpose.string1_rep.bmm.view.view
input.input_cluster.self.char_embeddings.float
utils.BPEEncoder.BPEEncoder.bpe
tqdm.tqdm
self.layer_conf.pool_axis.string_out.torch.sum.squeeze
idx.item
torch.nn.LogSoftmax
batch_size.seq_len.partition_history.torch.cat.view.transpose.contiguous.append
self.encode_data_multi_processor
self.id
zipfile.ZipFile
layer_name.eval.inference
seq_len.cpu.numpy
string_len.unsqueeze.to
layer_id.self.layers
new_tags.batch_size.seq_len.scores.view.torch.gather.view
kwargs.get
hidden_init.to.to
lm.model.layers.get_parameters
self.FullAttention.super.__init__
mask_idx.contiguous.view.contiguous
self.Concat2DConf.super.inference
join.rstrip
logits.squeeze.detach
torch.nn.Conv2d
single_true.self.normalize_answer.split
columns_to_target.keys
Evaluator
self.BiGRUConf.super.__init__
model.parameters
line.split.rstrip
target_batches.append
torch.nn.Embedding
model.layers.get_parameters
char_emb_layer
web.form.Button
energies.view.bmm
self.embedding.weight.data.uniform_
os.getcwd
NameError
name.startswith
logits_softmax.data.max.cpu
self.predict_fields_post_check.add
self.get_with_inst
self.ForgetMult.super.__init__
content.size
self.model.layers.embedding.embeddings.values
attention_weight.unsqueeze.expand_as
cut_and_padding
u.string.pow
idx.mask.view
self.ConvPoolingConf.super.verify_before_inference
object_inputs.keys
self.conf.pos_label.logits_softmax.cpu.data.numpy
self.BiLSTMLast.super.__init__
torch.nn.AvgPool1d
string2_len.cpu.numpy
self.LayerNorm.super.__init__
fin.extractall
self.EncoderDecoderConf.super.__init__
utils.common_utils.load_from_pkl
input.contiguous.view.contiguous
LearningMachine.LearningMachine.interactive
problem.output_target_num
self.c_attn.size
torch.load
self.ElementWisedMultiply3D.super.__init__
Digraph.node
self.MatchConf.super.verify
self.Minus2DConf.super.inference
self.conf.pos_label.logits_softmax.cpu
self.alpha.gather
tag_size.ins_num.feats.transpose.contiguous.view.expand
utils.ProcessorsScheduler.ProcessorsScheduler.run_data_parallel
mv.json2graph
input_type.self.input_dicts.build
sorted.append
torch.addcmul
self.Seq2SeqAttentionConf.super.inference
y_mask.torch.from_numpy.byte.to
i.string_mask.data.tolist.count
self.AttentionConf.super.verify
self.Conf.load_data.configurate_inputs
torch.nn.MaxPool1d
Loss.cuda
mask.transpose.contiguous
string_len_out.to.expand_as
self._get_save_encode_generator
self.Expand_plus.super.__init__
Cache.save
problem.problem_type.ProblemTypes.str.split.upper
Digraph
line.rstrip.rstrip
sample.rstrip.split
self.lstm.flatten_parameters
reverse_style
self.Seq2SeqAttentionConf.super.__init__
torch.LongTensor
self.layernorm1_conf_cls.verify
i.label_list.upper.replace
self.MultiHeadAttentionConf.super.inference
join
new_tags.transpose.contiguous.view.transpose
torch.FloatTensor
self.BiGRULastConf.super.__init__
self._verify_conf
self.layer_conf.hidden_dim.string1.size.string1_key.view.transpose.contiguous.view
self.GRU
self.Conv2D.super.__init__
self.SLUDecoderConf.super.inference
self.auc
torch.sigmoid.new_empty
base_filter
x.permute.contiguous
numpy.zeros
Y.view.chunk
self.Add2DConf.super.__init__
self.layer_conf.START_TAG.self.layer_conf.target_dict.inivalues.clone.view.contiguous
self._renew_cache
torch.cat.view
self.model
single_input_type.lower
input_cluster.layer_conf.conf.eval
self.Embedding.super.__init__
alphas.view.view
LSTMCharEmbedding
torch.bmm
LearningMachine.LearningMachine.train
hidden.size.hidden.view.unsqueeze.view
zip_ref.extractall
device.float.c_len.c_len.torch.ones.to.tril
torch.exp
self.verify_before_inference
torch.ones
self.Model.super.__init__
torch.nn.DataParallel
self.BiQRNNConf.super.__init__
self.BiLSTMLastConf.super.inference
layer_conf.layernorm1_name.eval
F.size.F.new_empty.bernoulli_
self.activation.size
self.cell_doc_count.update
list.squeeze
text.translate.translate
self.parameters
ModelConf.ModelConf.back_up
re.sub
self.char_lstm
self.Seq2SeqAttentionConf.super.verify
last_position.partition_history.torch.gather.view.expand
utils.exceptions.LayerConfigUndefinedError
argparse.ArgumentParser.parse_args
Evaluator.get_supported_metrics
eval
self.model.module.layers.embedding.embeddings.values
json2graph
decoded.transpose.transpose
self.Concat3DConf.super.inference
utils.corpus_utils.load_embedding
self.QRNN.super.__init__
torch.mul
loss_fn.backward
self.BiGRULast.super.__init__
utils.exceptions.PreprocessError
self.Conv2DConf.super.verify
metric_to_chk.split
self.format_result
utils.philly_utils.move_from_local_to_hdfs
single_word.lower
self.Conf.load_data.raise_configuration_error
conf.conf.get
query2content_att.unsqueeze.expand
y_mask.unsqueeze.expand.unsqueeze
p2.ls.unsqueeze
maketrans
idx.self.batch_norms
os.path.isabs
self.layer_conf.hidden_dim.string2.size.string2_key.view.transpose
labels_list.append
layer_id.self.layer_dependencies.remove
pad_zero.cuda.cuda
self.Conf.load_data.configurate_architecture
re.findall
self.output_dict.id
self.slot_out
utils.philly_utils.convert_to_hdfspath
IOError
string.shape.string.shape.masks.torch.stack.view.byte
self.output_layer_id.append
string.view.size
self.tokenizer.span_tokenize
sklearn.metrics.f1_score
m_size.idx.view.vec.torch.gather.view
logging.getLogger
chr
LearningMachine.LearningMachine.predict
logging.info
result.view.view
remove_punc
self.activation
torch.is_tensor
string2_mask.torch.from_numpy.unsqueeze.unsqueeze
string2_aug.contiguous.view
self.cov_dropout
multiprocessing.Pool.join
layer_id.self.layer_dependencies.add
self.output_dict.cell
self.ElementWisedMultiply3DConf.super.verify
string_len.sort
multiprocessing.Pool.close
file_path.len.new_block_path.split
add_item_loading_func
idx.labels.split
predict_output_path.startswith
self.QRNNLayer.super.__init__
nb_version.split
core.CellDict.CellDict
input_string.index
self.output_dict.cell_num
self.Attention.super.__init__
seq_len.cpu.numpy.cpu
lower
line.rstrip.split.split
masks.to.to
self.ConvConf.super.verify_before_inference
self.encoder_conf_cls.inference
curr_target.target_docs.append
self.activation.transpose
y_len.cpu
self.encoder_conf_cls.verify_before_inference
torch.nn.ParameterList
self.qrnn
problem.Problem.get_vocab_sizes
new_tags.transpose.contiguous
collections.OrderedDict
self.att.string_output.matmul.bmm
label_list.append
char_embs_lookup.view.view
self.FocalLoss.super.__init__
self.Flatten.super.__init__
string_len.cpu.data.numpy
self.Seq2SeqAttention.super.__init__
final_partition.sum
string2_mask.torch.from_numpy.unsqueeze
input_cluster.self.embeddings
self.ElementWisedMultiply2D.super.__init__
f.replace.replace
self.TransformerConf.super.__init__
self.Pooling.super.__init__
torch.nn.Softmax
self.LSTMCharEmbeddingConf.super.__init__
self.MatrixMultiplyConf.super.inference
self.pool
batch_size.pointer.contiguous.view.expand
content_aug.contiguous.view
queue.Queue.put
param_list.append
numpy.linspace
back_points.transpose.contiguous.transpose
self.evaluator.evaluate
m.group.pop
self.BiLSTMAtt.super.__init__
i.string_mask.data.tolist
utils.philly_utils.convert_to_tmppath
torch.log
x2.transpose
configurate_logger
input.cpu.input_cluster.self.embeddings.float
device.float.c_len.c_len.torch.ones.to.tril.unsqueeze
query_aug.contiguous.view
self.attn
os.mkdir
self.problem.output_target_num
LSTMCharEmbeddingConf
torch.device
bpe_tokens.extend
string2_HoW.contiguous.view
corpora_perm.append
Digraph.edge
logging.StreamHandler.setLevel
string.contiguous
torch.max
web.input
self.softmax.bmm
self.decoder
self.Concat3D.super.__init__
self._get_training_data_generator
torch.long.label_specified_idx.torch.tensor.logits_softmax.cpu.torch.index_select.squeeze
codecs.open
utils.ProcessorsScheduler.ProcessorsScheduler
layer_conf.activation.eval
join.index
curr_target.lengths.append
EnglishTokenizer.span_tokenize
i.col_index_types.split
i.target_batches.values
self._check_encoding
i.data_batches.keys
query2content_att.unsqueeze.expand.unsqueeze
torch.ByteTensor
metric.split
self.embedding
i.col_index_types.docs.append
self.layer_conf.attn_dropout.nn.Dropout
self.linear.unsqueeze
p1.data.masked_fill_
mode.lower
self.Attention.transpose
filter
gold_matrix.set.intersection
white_space_fix
self.MatrixMultiply.super.__init__
numpy.random.permutation
input
utils.BPEEncoder.BPEEncoder
self.MultiHeadAttentionConf.super.verify
torch.abs
tg_energy.masked_select.masked_select
self.max_lengths.values
content_aug.contiguous.view.contiguous
self.model.cuda
self.SLUEncoderConf.super.verify_before_inference
self.layer_conf.hidden_dim.string1.size.string1_key.view.transpose.contiguous.view.bmm
problem.problem_type.ProblemTypes.str.split
self.batch_norm.cuda
dict.append
logpt.view.gather
numpy.max
self.MatchConf.super.__init__
name.self.__recorder.extend
layer.reset
self.Expand_plusConf.super.inference
self.LinearConf.super.verify_before_inference
crf_layer_conf.STOP_TAG.crf_layer_conf.target_dict.transitions.contiguous
os.makedirs
os.path.isdir
self._merge_encode_lengths
mask.long.torch.sum.view
self._check_dictionary
logpt.data.exp
model.module.layers.get_parameters
math.sqrt
startOfChunk
string2_HoW.contiguous
string_out.torch.squeeze.permute
torch.randn
self.c_attn.permute
argparse.ArgumentParser.add_argument
self.batch_norms.append
utils.common_utils.transfer_to_gpu
target.data.view
string_reshaped.self.char_embeddings.float
self.Minus2DConf.super.__init__
float
self.BiAttFlowConf.super.inference
diff_field.split
pickle.dump
encoder_outputs.contiguous.view
tarfile.open
char_hidden.transpose.contiguous
self.get_topological_sequence
single_layer.items
range
self.layer_conf.hidden_dim.string2.size.string2_key.view.transpose.contiguous.view.transpose
get_pairs.add
StreamingRecorder.record
self.multi_loss_op.lower
self.add_attr_exist_assertion_for_user
self.add_attr_type_assertion
dir
self.add_attr_range_assertion
float.c_len.c_len.torch.ones.to
self.attention_conf_cls.inference
next_hidden.torch.cat.view.append
self.LinearConf.super.verify
self.lstm
result.append
self.Conf.load_data.configurate_outputs
padding_mask.torch.from_numpy.byte.to
mask_idx.contiguous.view
utils.common_utils.transform_params2tensors
content.unsqueeze
model_save_path.startswith
alphas.view.bmm
string_out.transpose.contiguous.transpose
problem.Problem
self.read_process_file
len
self.decoder_conf_cls.verify
re.finditer
self.Conf.load_data.check_version_compat
feats.transpose.contiguous.view
words_list.append
x1.view.view
self.W
self.MatchAttentionConf.super.__init__
fin.readline.rstrip
self.layer_conf.pool_axis.string.torch.sum.squeeze
self.HighwayLinearConf.super.inference
self.Concat3DConf.super.__init__
self.cov_dropout.cuda
list.sort
optimizer.zero_grad
warnings.filterwarnings
string_mask.to.to
self.model.parameters
torch.nn.parameter.Parameter
web.template.render
web.seeother
self.mlp_conf_cls.inference
length_batches.keys
u.string.pow.mean
metric.self.getattr
tuple
Cache
input_type.append
torch.cuda.device_count
self.encoder
self.output_dict.lookup
enum.Enum
self.filters.append
type_key.lower
torch.unsqueeze
tensor.flip
self._viterbi_decode
self.TransformerConf.super.verify
self.ConvPooling.super.__init__
mask.transpose
self.alpha.type_as
conf_version.split
data_all.append
NewsGroup
utils.philly_utils.HDFSDirectTransferer
masks.cuda.cuda
context_init.to.to
vars
cls.concat_key_desc
decoded.transpose.to
f_w.write
self.ElementWisedMultiply3DConf.super.inference
branch.lengths.append
logging.warning
label.append
self.linear
settings.LossOperationType.__members__.keys
f_r.readlines
key.results.append
file_path.len.new_block_path.split.pop
self.output_dict.build
y_mask.torch.from_numpy.byte
torch.nn.Dropout
torch.nn.functional.log_softmax
extra_info_type.data.append
metric.startswith
decode_idx.transpose.transpose
utils.common_utils.md5
numpy.random.randn
self.FlattenConf.super.verify
self.CombinationConf.super.verify
string_len.cpu
torch.nn.init.uniform_
numpy.array.append
self.Conv.super.__init__
torch.sum
tag_size.ins_num.feats.transpose.contiguous.view.expand.transpose
conf.predict_file_columns.keys
layer_id2.self.layer_dependencies.remove
open.readline
StreamingRecorder.get
curr_target.target.append
self.BiAttFlowConf.super.verify
input_type.self.input_dicts.cell_num
self.input_dicts.cell_id_map.keys
input_type.self.input_dicts.update
sklearn.model_selection.train_test_split
list.view
open_and_move
shutil.move
prediction.append
LearningMachine.LearningMachine.test
self.get_data_generator_from_file
self.layer_conf.START_TAG.self.layer_conf.target_dict.inivalues.clone.view.masked_scatter_
self.Minus3DConf.super.inference
self.Interaction.super.__init__
self.Concat2DConf.super.verify
self.layers.keys
self.Minus3DConf.super.__init__
self.SLUEncoderConf.super.__init__
utils.exceptions.ConfigurationError
lm.model.module.layers.get_parameters
batch_with_pad.append
file.read
input_cluster.layer_conf.conf.eval.inference
f.readline
self.MatchAttentionConf.super.inference
jieba.setLogLevel
temp_word_length.append
string.size
text_lines.join.replace
self.output_dict.decode
m_size.idx.view.vec.torch.gather.view.expand_as
y.x.torch.abs.max
problem.Problem.build
problem.output_dict.id
core.StreamingRecorder.StreamingRecorder.record_one_row
self.TransformerConf.super.inference
calculate_AUC
callable
string_len_out.to.unsqueeze
self.Add2DConf.super.inference
topological_list.append
partition_history.torch.cat.view
torch.nn.Conv1d
masks.to.append
zip
init_transitions.cuda.cuda
string2_len.cpu
self.model.eval
console_level.upper
torch.nn.Softmax.unsqueeze
self.c_attn
setattr
batch_size.seq_len.partition_history.torch.cat.view.transpose
remove_articles
self.CalculateDistance.super.__init__
gensim.models.keyedvectors.KeyedVectors.load_word2vec_format
ChineseTokenizer.tokenize
p2.data.masked_fill_
kwargs.lower
results.items
cpu_element.to
illegal_fields.append
self.MatchConf.super.inference
temp_logits_flat.detach.cpu
real_context.append
self.DropoutConf.super.verify
temp_word_char.append
web.form.Form
self.Minus3D.super.__init__
field.startswith
self.record
self.BiQRNNConf.super.verify
length_batches.append
input.contiguous.view.size
self.LinearConf.super.__init__
bpe_path.open.read
QRNN
string_output.transpose.contiguous
dict.values
tuple.append
torch.nn.functional.softmax
self.default
self.Add3D.super.__init__
self.problem.encode
self.transitions.view
y_len.cpu.numpy
collections.Counter.values
input_cluster.lower
test_path.endswith
self.problem.decode
getattr
layer_name.eval.verify_former_block
branch.lengths.pop
torch.cuda.empty_cache
numpy.array.values
fin.write
self.Conv2DConf.super.inference
numpy.sum
batch_size.seq_len.partition_history.torch.cat.view.transpose.contiguous
BPEEncoder
input_cluster.layer_arch.get
self.problem.get_encode_generator
self.Conf.load_data.configurate_training_params
torch.add
x2.transpose.contiguous
sub_emb.self.embeddings.parameters
string_aug.contiguous.view.contiguous
problem.Problem.load_problem
rest_layers.append
filepath.replace.replace
id
web.application.run
codecs.open.write
cell.format.encode
attn_energies.squeeze.masked_fill.squeeze
list.values
self.FlattenConf.super.__init__
self.input_types.keys
self.layer_conf.START_TAG.self.layer_conf.target_dict.inivalues.clone
loss.sum
self.ElementWisedMultiply3DConf.super.__init__
torch.nn.functional.dropout.dim
self.LinearAttentionConf.super.verify
sklearn.metrics.mean_squared_error
self.Pooling2DConf.super.verify
confidence_specified.data.numpy
torch.nn.functional.max_pool1d
self.BiLSTMLastConf.super.__init__
string_conv.size.string_conv.F.max_pool1d.squeeze
m.group
self.BiLSTMConf.super.__init__
Exception
tempfile.gettempdir
self.Attention
energies.view.view
self.layernorm1_conf_cls.inference
pathname_list.append
self.LayerNormConf.super.__init__
string2_mask.torch.from_numpy.unsqueeze.unsqueeze.expand_as
get_vocab_info
copy.deepcopy
logging.getLogger.addHandler
f.write
string.unsqueeze.expand
list.remove
sklearn.metrics.recall_score
string.transpose
self.Conf.load_data.configurate_cache
torch.nn.ModuleList
self.postag
sklearn.metrics.roc_auc_score
mask.long.byte.transpose
type_branch.branch.dest_dict.extend
single_loss.eval
random.choice
StreamingRecorder
self.Minus2D.super.__init__
back_points.transpose.contiguous.scatter_
string.index_select.index_select
self.char_lstm.cuda
self.attention_conf_cls.verify
torch.gather.sum
next
os.path.join
vec.split
self.BiGRUConf.super.inference

@developer
Could please help me check this issue?
May I pull a request to fix it?
Thank you very much.

Can we do more lower-level stuffs?

After trying this project, I found that we may implement many upper-level tasks. However it is not easy for us to modify something lower-level such as word embedding. It would be helpful if it supports more lower-level stuffs on NLP. Thanks!

Segmentation fault(error)

when i used the conf of text_classification to fit data, i meet a segment default....
the max length of my training data is 1500, Is it caused by it?

Issue when running the Quick Start steps from Tutorial

When running the command "python3 train.py --conf_path=model_zoo/demo/conf.json" (from the Tutorial) , I get the following error:

Traceback (most recent call last):
File "train.py", line 4, in
from settings import ProblemTypes, version, Setting as st
File "/home/bruno/Python/Neuron_Blocks/NeuronBlocks-master/settings.py", line 9, in
import nltk
File "/home/bruno/.local/lib/python3.8/site-packages/nltk/init.py", line 143, in
from nltk.chunk import *
File "/home/bruno/.local/lib/python3.8/site-packages/nltk/chunk/init.py", line 157, in
from nltk.chunk.api import ChunkParserI
File "/home/bruno/.local/lib/python3.8/site-packages/nltk/chunk/api.py", line 13, in
from nltk.parse import ParserI
File "/home/bruno/.local/lib/python3.8/site-packages/nltk/parse/init.py", line 100, in
from nltk.parse.transitionparser import TransitionParser
File "/home/bruno/.local/lib/python3.8/site-packages/nltk/parse/transitionparser.py", line 22, in
from sklearn.datasets import load_svmlight_file
File "/home/bruno/.local/lib/python3.8/site-packages/sklearn/init.py", line 64, in
from .base import clone
File "/home/bruno/.local/lib/python3.8/site-packages/sklearn/base.py", line 14, in
from .utils.fixes import signature
File "/home/bruno/.local/lib/python3.8/site-packages/sklearn/utils/init.py", line 14, in
from . import _joblib
File "/home/bruno/.local/lib/python3.8/site-packages/sklearn/utils/_joblib.py", line 22, in
from ..externals import joblib
File "/home/bruno/.local/lib/python3.8/site-packages/sklearn/externals/joblib/init.py", line 119, in
from .parallel import Parallel
File "/home/bruno/.local/lib/python3.8/site-packages/sklearn/externals/joblib/parallel.py", line 28, in
from ._parallel_backends import (FallbackToBackend, MultiprocessingBackend,
File "/home/bruno/.local/lib/python3.8/site-packages/sklearn/externals/joblib/_parallel_backends.py", line 22, in
from .executor import get_memmapping_executor
File "/home/bruno/.local/lib/python3.8/site-packages/sklearn/externals/joblib/executor.py", line 14, in
from .externals.loky.reusable_executor import get_reusable_executor
File "/home/bruno/.local/lib/python3.8/site-packages/sklearn/externals/joblib/externals/loky/init.py", line 12, in
from .backend.reduction import set_loky_pickler
File "/home/bruno/.local/lib/python3.8/site-packages/sklearn/externals/joblib/externals/loky/backend/reduction.py", line 125, in
from sklearn.externals.joblib.externals import cloudpickle # noqa: F401
File "/home/bruno/.local/lib/python3.8/site-packages/sklearn/externals/joblib/externals/cloudpickle/init.py", line 3, in
from .cloudpickle import *
File "/home/bruno/.local/lib/python3.8/site-packages/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py", line 167, in
_cell_set_template_code = _make_cell_set_template_code()
File "/home/bruno/.local/lib/python3.8/site-packages/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py", line 148, in _make_cell_set_template_code
return types.CodeType(
TypeError: an integer is required (got type bytes)


Before running that command, I just followed the Installation steps from the Tutorial. I have Python 3.8.2 installed, and OS Ubuntu 20.04 LTS. Maybe someone could assist me with that?

non-contiguous input

When I set the batch size as 128, there will occurs an problem. CUDNN_STATUS_NOT_SUPPORTED. This error may appear if you passed in a non-contiguous input. When I set a smaller batch size, it goes pretty well. I think it is caused by the char embedding.

CNNCharEmbedding ERROR

when using CharEmbedding, I meet the following error.

"/NeuronBlocks/block_zoo/Embedding.py", line 163, in forward
    if self.embeddings[input_cluster].weight.device.type == 'cpu':
AttributeError: 'CNNCharEmbedding' object has no attribute 'weight'

Data skew problem

Does the configuartion of model_zoo have an option to resolve the data skewing problem that
a small number of categories be misclassified?

IndexError: tuple index out of range

when I run python train.py --conf_path=model_zoo/demo/conf.json . An Error occurs, anyone meet this error:
Traceback (most recent call last):
File "train.py", line 275, in
main(params)
File "train.py", line 227, in main
lm.train(optimizer, loss_fn)
File "/NeuronBlocks-master/LearningMachine.py", line 156, in train
logits_softmax = self.model(inputs_desc, length_desc, *param_list)
File "
/anaconda3/envs/py35/lib/python3.5/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/NeuronBlocks-master/Model.py", line 357, in forward
inputs, lengths = transform_tensors2params(inputs_desc, length_desc, param_list)
File "
/NeuronBlocks-master/utils/common_utils.py", line 176, in transform_tensors2params
lengths[key] = param_list[length_desc[key]]
IndexError: tuple index out of range

AttributeError: 'ReLU' object has no attribute 'weight'

Hi, I met a problem in CNNCharEmbedding.py. The ReLU has no weight. It seems like there should be a difference for the activation functions with weight and without weight.
Thank you !

Traceback (most recent call last):
File "train.py", line 372, in
main(params)
File "train.py", line 283, in main
lm = LearningMachine('train', conf, problem, vocab_info=vocab_info, initialize=initialize, use_gpu=conf.use_gpu)
File "/nb_code1/LearningMachine.py", line 38, in init
self.model = Model(conf, problem, vocab_info, use_gpu)
File "/nb_code1/Model.py", line 210, in init
self.add_layer(EMBED_LAYER_ID, get_layer(layer_arch['layer'], all_layer_configs[EMBED_LAYER_ID]))
File "/nb_code1/Model.py", line 121, in get_layer
layer = eval(layer_name)(conf)
File "/nb_code1/block_zoo/Embedding.py", line 125, in init
self.embeddings[input_cluster] = eval(layer_conf.conf[input_cluster]['type'])(char_emb_conf)
File "/nb_code1/block_zoo/embedding/CNNCharEmbedding.py", line 81, in init
self.activation.weight = torch.nn.Parameter(self.activation.weight.cuda())
File "anaconda3/envs/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 535, in getattr
type(self).name, name))
AttributeError: 'ReLU' object has no attribute 'weight'

support pytorch>=1.7

🐛 Bug

When I run under torch 1.8, the following errors are generated.

nn.utils.rnn.pack_padded_sequence: RuntimeError: 'lengths' argument should be a 1D CPU int64 tensor, but got 1D cuda:0 Long tensor

Solution

pytorch/pytorch#43227

Issues with NLTK packages

When I am installing packages in requirements.txt, I encountered this error:"
ERROR: Could not find a version that satisfies the requirement nltk==3.4.1 (from -r requirements.txt (line 1)) (from versions: none)
ERROR: No matching distribution found for nltk==3.4.1 (from -r requirements.txt (line 1))"

Also, I can't train the module with command "python train.py --conf_path=model_zoo/demo/conf.json", I got this error:
File "C:\nlp\NeuronBlocks\settings.py", line 9, in
import nltk
ModuleNotFoundError: No module named 'nltk'

RuntimeError: set_storage is not allowed on Tensor created from .data or .detach()

Hi, I met a problem when I am running the train.py. My command is python train.py --conf_path=myconfig.json. However, I met this error. Do you know the possible reasons ? Thanks!
File "train.py", line 275, in
main(params)
File "train.py", line 227, in main
lm.train(optimizer, loss_fn)
File "/code2/LearningMachine.py", line 279, in train
model_save_path=self.conf.model_save_path, phase="valid", epoch=epoch)
File "/code2/LearningMachine.py", line 404, in evaluate
logits_softmax = self.model(inputs_desc, length_desc, *param_list)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/parallel/data_parallel.py", line 152, in forward
outputs = self.parallel_apply(replicas, inputs, kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/parallel/data_parallel.py", line 162, in parallel_apply
return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
File "/usr/local/lib/python3.6/dist-packages/torch/nn/parallel/parallel_apply.py", line 83, in parallel_apply
raise output
File "/usr/local/lib/python3.6/dist-packages/torch/nn/parallel/parallel_apply.py", line 59, in _worker
output = module(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/code2/Model.py", line 378, in forward
representation[layer_id], repre_lengths[layer_id] = self.layerslayer_id
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/code2/block_zoo/BiLSTM.py", line 84, in forward
self.lstm.flatten_parameters()
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/rnn.py", line 123, in flatten_parameters
self.batch_first, bool(self.bidirectional))
RuntimeError: set_storage is not allowed on Tensor created from .data or .detach()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.