<jupyter_start><jupyter_text><jupyter_code>from google.colab import drive
drive.mount('/content/drive/')
!pwd
import os
os.chdir('/content/drive/MyDrive/mmh/ABSA-PyTorch-master')
!pwd
!ls
import os
path = "/content/drive/MyDrive/mmh/ABSA-PyTorch-master"
os.chdir(path)
os.listdir(path)
import torch
print(torch.__version__)
!pip install torch==1.6.0 torchvision==0.7.0
!pip install -r requirements.txt.
import transformers
print(transformers.__version__)
!pip install transformers==3.5.1
!python train.py --model_name bert_spc --dataset peerreview --optimizer adamax
from google.colab import files
files.upload()  # 会返回已上传文件的字典。 此字典的键为文件名，值为已上传的数据
!python train.py --model_name lcf_bert --dataset peerreview
!python train.py --model_name aen_bert --dataset peerreview<jupyter_output>2021-08-04 04:03:47.130709: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0
cuda memory allocated: 452894208
> n_trainable_params: 112937661, n_nontrainable_params: 0
> training arguments:
>>> model_name: aen_bert
>>> dataset: peerreview
>>> optimizer: <class 'torch.optim.adam.Adam'>
>>> initializer: <function xavier_uniform_ at 0x7f4e27e99050>
>>> lr: 2e-05
>>> dropout: 0.1
>>> l2reg: 0.01
>>> num_epoch: 20
>>> batch_size: 16
>>> log_step: 10
>>> embed_dim: 300
>>> hidden_dim: 300
>>> bert_dim: 768
>>> pretrained_bert_name: bert-base-uncased
>>> max_seq_len: 85
>>> polarities_dim: 3
>>> hops: 3
>>> patience: 5
>>> device: cuda
>>> seed: 1234
>>> valset_ratio: 0
>>> local_context_focus: cdm
>>> SRD: 3
>>> model_class: <class 'models.aen.AEN_BERT'>
>>> dataset_file: {'train': './datasets/iclr-peerreview/train.raw', 'test': './datasets/iclr-peerreview/test.raw'}
>>> inputs_cols: ['text_bert_indices', 'aspect_bert_indic[...]
{'fraction_non_alphanumeric': 0.15715883668903805, 'fraction_numerical': 0.05480984340044743, 'mean_word_length': 5.9073359073359075, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 87, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '241633', 'license': 'Apache-2.0', 'n_tokens_mistral': 753, 'n_tokens_neox': 679, 'n_words': 140, 'path': 'bertmodel.ipynb', 'repo_name': 'mmh-max/AutoPhrase', 'size': '1788'}