Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
曾经的那一瞬间
Models
提交
cd5e1204
M
Models
项目概览
曾经的那一瞬间
/
Models
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
Models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cd5e1204
编写于
10月 26, 2020
作者:
H
Hongkun Yu
提交者:
A. Unique TensorFlower
10月 26, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Py3 cleanup for nlp/
PiperOrigin-RevId: 339071563
上级
cdd0347a
变更
65
显示空白变更内容
内联
并排
Showing
65 changed file
with
1 addition
and
259 deletion
+1
-259
official/nlp/albert/configs.py
official/nlp/albert/configs.py
+0
-4
official/nlp/albert/export_albert_tfhub.py
official/nlp/albert/export_albert_tfhub.py
+0
-4
official/nlp/albert/export_albert_tfhub_test.py
official/nlp/albert/export_albert_tfhub_test.py
+0
-4
official/nlp/albert/run_classifier.py
official/nlp/albert/run_classifier.py
+0
-5
official/nlp/albert/run_squad.py
official/nlp/albert/run_squad.py
+0
-4
official/nlp/bert/bert_models.py
official/nlp/bert/bert_models.py
+0
-4
official/nlp/bert/bert_models_test.py
official/nlp/bert/bert_models_test.py
+0
-3
official/nlp/bert/configs.py
official/nlp/bert/configs.py
+0
-4
official/nlp/bert/export_tfhub.py
official/nlp/bert/export_tfhub.py
+0
-4
official/nlp/bert/export_tfhub_test.py
official/nlp/bert/export_tfhub_test.py
+0
-4
official/nlp/bert/input_pipeline.py
official/nlp/bert/input_pipeline.py
+0
-4
official/nlp/bert/model_saving_utils.py
official/nlp/bert/model_saving_utils.py
+0
-5
official/nlp/bert/model_training_utils.py
official/nlp/bert/model_training_utils.py
+0
-4
official/nlp/bert/model_training_utils_test.py
official/nlp/bert/model_training_utils_test.py
+0
-4
official/nlp/bert/run_classifier.py
official/nlp/bert/run_classifier.py
+0
-3
official/nlp/bert/run_pretraining.py
official/nlp/bert/run_pretraining.py
+0
-3
official/nlp/bert/run_squad.py
official/nlp/bert/run_squad.py
+0
-4
official/nlp/bert/run_squad_helper.py
official/nlp/bert/run_squad_helper.py
+0
-3
official/nlp/bert/squad_evaluate_v1_1.py
official/nlp/bert/squad_evaluate_v1_1.py
+0
-4
official/nlp/bert/squad_evaluate_v2_0.py
official/nlp/bert/squad_evaluate_v2_0.py
+0
-4
official/nlp/bert/tf1_checkpoint_converter_lib.py
official/nlp/bert/tf1_checkpoint_converter_lib.py
+0
-3
official/nlp/bert/tf2_encoder_checkpoint_converter.py
official/nlp/bert/tf2_encoder_checkpoint_converter.py
+0
-3
official/nlp/bert/tokenization.py
official/nlp/bert/tokenization.py
+0
-4
official/nlp/bert/tokenization_test.py
official/nlp/bert/tokenization_test.py
+0
-3
official/nlp/data/classifier_data_lib.py
official/nlp/data/classifier_data_lib.py
+0
-4
official/nlp/data/create_finetuning_data.py
official/nlp/data/create_finetuning_data.py
+0
-4
official/nlp/data/create_pretraining_data.py
official/nlp/data/create_pretraining_data.py
+0
-3
official/nlp/data/squad_lib.py
official/nlp/data/squad_lib.py
+0
-5
official/nlp/data/squad_lib_sp.py
official/nlp/data/squad_lib_sp.py
+0
-4
official/nlp/modeling/networks/classification.py
official/nlp/modeling/networks/classification.py
+0
-4
official/nlp/modeling/networks/encoder_scaffold.py
official/nlp/modeling/networks/encoder_scaffold.py
+0
-5
official/nlp/modeling/networks/span_labeling.py
official/nlp/modeling/networks/span_labeling.py
+0
-4
official/nlp/nhnet/decoder.py
official/nlp/nhnet/decoder.py
+0
-5
official/nlp/nhnet/decoder_test.py
official/nlp/nhnet/decoder_test.py
+0
-4
official/nlp/nhnet/input_pipeline.py
official/nlp/nhnet/input_pipeline.py
+1
-5
official/nlp/nhnet/models.py
official/nlp/nhnet/models.py
+0
-6
official/nlp/nhnet/optimizer.py
official/nlp/nhnet/optimizer.py
+0
-5
official/nlp/nhnet/trainer.py
official/nlp/nhnet/trainer.py
+0
-4
official/nlp/nhnet/utils.py
official/nlp/nhnet/utils.py
+0
-5
official/nlp/transformer/attention_layer.py
official/nlp/transformer/attention_layer.py
+0
-5
official/nlp/transformer/compute_bleu.py
official/nlp/transformer/compute_bleu.py
+0
-4
official/nlp/transformer/data_download.py
official/nlp/transformer/data_download.py
+0
-4
official/nlp/transformer/data_pipeline.py
official/nlp/transformer/data_pipeline.py
+0
-4
official/nlp/transformer/embedding_layer.py
official/nlp/transformer/embedding_layer.py
+0
-4
official/nlp/transformer/ffn_layer.py
official/nlp/transformer/ffn_layer.py
+0
-4
official/nlp/transformer/metrics.py
official/nlp/transformer/metrics.py
+0
-3
official/nlp/transformer/misc.py
official/nlp/transformer/misc.py
+0
-4
official/nlp/transformer/model_utils.py
official/nlp/transformer/model_utils.py
+0
-4
official/nlp/transformer/model_utils_test.py
official/nlp/transformer/model_utils_test.py
+0
-4
official/nlp/transformer/optimizer.py
official/nlp/transformer/optimizer.py
+0
-4
official/nlp/transformer/transformer.py
official/nlp/transformer/transformer.py
+0
-3
official/nlp/transformer/transformer_layers_test.py
official/nlp/transformer/transformer_layers_test.py
+0
-4
official/nlp/transformer/transformer_main.py
official/nlp/transformer/transformer_main.py
+0
-3
official/nlp/transformer/transformer_main_test.py
official/nlp/transformer/transformer_main_test.py
+0
-4
official/nlp/transformer/transformer_test.py
official/nlp/transformer/transformer_test.py
+0
-4
official/nlp/transformer/translate.py
official/nlp/transformer/translate.py
+0
-4
official/nlp/xlnet/common_flags.py
official/nlp/xlnet/common_flags.py
+0
-4
official/nlp/xlnet/data_utils.py
official/nlp/xlnet/data_utils.py
+0
-5
official/nlp/xlnet/optimization.py
official/nlp/xlnet/optimization.py
+0
-4
official/nlp/xlnet/preprocess_classification_data.py
official/nlp/xlnet/preprocess_classification_data.py
+0
-3
official/nlp/xlnet/preprocess_pretrain_data.py
official/nlp/xlnet/preprocess_pretrain_data.py
+0
-4
official/nlp/xlnet/preprocess_squad_data.py
official/nlp/xlnet/preprocess_squad_data.py
+0
-3
official/nlp/xlnet/preprocess_utils.py
official/nlp/xlnet/preprocess_utils.py
+0
-3
official/nlp/xlnet/training_utils.py
official/nlp/xlnet/training_utils.py
+0
-4
official/nlp/xlnet/xlnet_config.py
official/nlp/xlnet/xlnet_config.py
+0
-5
未找到文件。
official/nlp/albert/configs.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""The ALBERT configurations."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
six
from
official.nlp.bert
import
configs
...
...
official/nlp/albert/export_albert_tfhub.py
浏览文件 @
cd5e1204
...
...
@@ -13,10 +13,6 @@
# limitations under the License.
# ==============================================================================
"""A script to export the ALBERT core model as a TF-Hub SavedModel."""
from
__future__
import
absolute_import
from
__future__
import
division
# from __future__ import google_type_annotations
from
__future__
import
print_function
# Import libraries
from
absl
import
app
...
...
official/nlp/albert/export_albert_tfhub_test.py
浏览文件 @
cd5e1204
...
...
@@ -13,10 +13,6 @@
# limitations under the License.
# ==============================================================================
"""Tests official.nlp.albert.export_albert_tfhub."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
import
numpy
as
np
...
...
official/nlp/albert/run_classifier.py
浏览文件 @
cd5e1204
...
...
@@ -14,11 +14,6 @@
# ==============================================================================
"""ALBERT classification finetuning runner in tf2.x."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
json
import
os
# Import libraries
...
...
official/nlp/albert/run_squad.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Run ALBERT on SQuAD 1.1 and SQuAD 2.0 in TF 2.x."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
json
import
os
import
time
...
...
official/nlp/bert/bert_models.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""BERT models that are compatible with TF 2.0."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
gin
import
tensorflow
as
tf
import
tensorflow_hub
as
hub
...
...
official/nlp/bert/bert_models_test.py
浏览文件 @
cd5e1204
...
...
@@ -12,9 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
tensorflow
as
tf
...
...
official/nlp/bert/configs.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""The main BERT model and related functions."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
copy
import
json
...
...
official/nlp/bert/export_tfhub.py
浏览文件 @
cd5e1204
...
...
@@ -13,10 +13,6 @@
# limitations under the License.
# ==============================================================================
"""A script to export the BERT core model as a TF-Hub SavedModel."""
from
__future__
import
absolute_import
from
__future__
import
division
# from __future__ import google_type_annotations
from
__future__
import
print_function
# Import libraries
from
absl
import
app
...
...
official/nlp/bert/export_tfhub_test.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Tests official.nlp.bert.export_tfhub."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
from
absl.testing
import
parameterized
...
...
official/nlp/bert/input_pipeline.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""BERT model input pipelines."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
tensorflow
as
tf
...
...
official/nlp/bert/model_saving_utils.py
浏览文件 @
cd5e1204
...
...
@@ -14,11 +14,6 @@
# ==============================================================================
"""Utilities to save models."""
from
__future__
import
absolute_import
from
__future__
import
division
# from __future__ import google_type_annotations
from
__future__
import
print_function
import
os
from
absl
import
logging
...
...
official/nlp/bert/model_training_utils.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""A light weight utilities to train NLP models."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
json
import
os
import
tempfile
...
...
official/nlp/bert/model_training_utils_test.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Tests for official.modeling.training.model_training_utils."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
from
absl
import
logging
...
...
official/nlp/bert/run_classifier.py
浏览文件 @
cd5e1204
...
...
@@ -13,9 +13,6 @@
# limitations under the License.
# ==============================================================================
"""BERT classification or regression finetuning runner in TF 2.x."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
functools
import
json
...
...
official/nlp/bert/run_pretraining.py
浏览文件 @
cd5e1204
...
...
@@ -13,9 +13,6 @@
# limitations under the License.
# ==============================================================================
"""Run masked LM/next sentence pre-training for BERT in TF 2.x."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
# Import libraries
from
absl
import
app
...
...
official/nlp/bert/run_squad.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Run BERT on SQuAD 1.1 and SQuAD 2.0 in TF 2.x."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
json
import
os
import
time
...
...
official/nlp/bert/run_squad_helper.py
浏览文件 @
cd5e1204
...
...
@@ -13,9 +13,6 @@
# limitations under the License.
# ==============================================================================
"""Library for running BERT family models on SQuAD 1.1/2.0 in TF 2.x."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
collections
import
json
...
...
official/nlp/bert/squad_evaluate_v1_1.py
浏览文件 @
cd5e1204
...
...
@@ -22,10 +22,6 @@ Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, Percy Liang
https://nlp.stanford.edu/pubs/rajpurkar2016squad.pdf
"""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
collections
import
re
import
string
...
...
official/nlp/bert/squad_evaluate_v2_0.py
浏览文件 @
cd5e1204
...
...
@@ -22,10 +22,6 @@ This file is expected to map question ID's to the model's predicted probability
that a question is unanswerable.
"""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
collections
import
re
import
string
...
...
official/nlp/bert/tf1_checkpoint_converter_lib.py
浏览文件 @
cd5e1204
...
...
@@ -13,9 +13,6 @@
# limitations under the License.
# ==============================================================================
r
"""Convert checkpoints created by Estimator (tf1) to be Keras compatible."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
numpy
as
np
import
tensorflow.compat.v1
as
tf
# TF 1.x
...
...
official/nlp/bert/tf2_encoder_checkpoint_converter.py
浏览文件 @
cd5e1204
...
...
@@ -18,9 +18,6 @@ The conversion will yield an object-oriented checkpoint that can be used
to restore a BertEncoder or BertPretrainerV2 object (see the `converted_model`
FLAG below).
"""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
...
...
official/nlp/bert/tokenization.py
浏览文件 @
cd5e1204
...
...
@@ -19,10 +19,6 @@ The file is forked from:
https://github.com/google-research/bert/blob/master/tokenization.py.
"""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
collections
import
re
import
unicodedata
...
...
official/nlp/bert/tokenization_test.py
浏览文件 @
cd5e1204
...
...
@@ -12,9 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
import
tempfile
...
...
official/nlp/data/classifier_data_lib.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""BERT library to process data for classification task."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
collections
import
csv
import
importlib
...
...
official/nlp/data/create_finetuning_data.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""BERT finetuning task dataset generator."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
functools
import
json
import
os
...
...
official/nlp/data/create_pretraining_data.py
浏览文件 @
cd5e1204
...
...
@@ -13,9 +13,6 @@
# limitations under the License.
# ==============================================================================
"""Create masked LM/next sentence masked_lm TF examples for BERT."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
collections
import
itertools
...
...
official/nlp/data/squad_lib.py
浏览文件 @
cd5e1204
...
...
@@ -13,12 +13,7 @@
# limitations under the License.
# ==============================================================================
"""Library to process data for SQuAD 1.1 and SQuAD 2.0."""
# pylint: disable=g-bad-import-order
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
collections
import
copy
import
json
...
...
official/nlp/data/squad_lib_sp.py
浏览文件 @
cd5e1204
...
...
@@ -18,10 +18,6 @@ The file is forked from:
https://github.com/google-research/ALBERT/blob/master/run_squad_sp.py
"""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
collections
import
copy
import
json
...
...
official/nlp/modeling/networks/classification.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Classification and regression network."""
# pylint: disable=g-classes-have-attributes
from
__future__
import
absolute_import
from
__future__
import
division
# from __future__ import google_type_annotations
from
__future__
import
print_function
import
collections
import
tensorflow
as
tf
...
...
official/nlp/modeling/networks/encoder_scaffold.py
浏览文件 @
cd5e1204
...
...
@@ -15,11 +15,6 @@
# ==============================================================================
"""Transformer-based text encoder network."""
# pylint: disable=g-classes-have-attributes
from
__future__
import
absolute_import
from
__future__
import
division
# from __future__ import google_type_annotations
from
__future__
import
print_function
import
inspect
from
absl
import
logging
...
...
official/nlp/modeling/networks/span_labeling.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Span labeling network."""
# pylint: disable=g-classes-have-attributes
from
__future__
import
absolute_import
from
__future__
import
division
# from __future__ import google_type_annotations
from
__future__
import
print_function
import
collections
import
tensorflow
as
tf
...
...
official/nlp/nhnet/decoder.py
浏览文件 @
cd5e1204
...
...
@@ -14,11 +14,6 @@
# ==============================================================================
"""Transformer decoder that mimics a BERT encoder, to load BERT checkpoints."""
from
__future__
import
absolute_import
from
__future__
import
division
# from __future__ import google_type_annotations
from
__future__
import
print_function
import
tensorflow
as
tf
from
official.modeling
import
tf_utils
from
official.nlp.modeling
import
layers
...
...
official/nlp/nhnet/decoder_test.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Tests for nlp.nhnet.decoder."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
numpy
as
np
import
tensorflow
as
tf
from
official.nlp.modeling
import
layers
...
...
official/nlp/nhnet/input_pipeline.py
浏览文件 @
cd5e1204
...
...
@@ -14,11 +14,7 @@
# ==============================================================================
"""Input pipelines."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
tensorflow.compat.v2
as
tf
import
tensorflow
as
tf
def
decode_record
(
record
,
name_to_features
):
...
...
official/nlp/nhnet/models.py
浏览文件 @
cd5e1204
...
...
@@ -13,12 +13,6 @@
# limitations under the License.
# ==============================================================================
"""tf.keras Models for NHNet."""
from
__future__
import
absolute_import
from
__future__
import
division
# from __future__ import google_type_annotations
from
__future__
import
print_function
from
absl
import
logging
import
gin
import
tensorflow
as
tf
...
...
official/nlp/nhnet/optimizer.py
浏览文件 @
cd5e1204
...
...
@@ -14,11 +14,6 @@
# ==============================================================================
"""Optimizer and learning rate scheduler."""
from
__future__
import
absolute_import
from
__future__
import
division
# from __future__ import google_type_annotations
from
__future__
import
print_function
import
tensorflow
as
tf
from
official.modeling.hyperparams
import
params_dict
...
...
official/nlp/nhnet/trainer.py
浏览文件 @
cd5e1204
...
...
@@ -15,10 +15,6 @@
# ==============================================================================
"""Run NHNet model training and eval."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
# Import libraries
...
...
official/nlp/nhnet/utils.py
浏览文件 @
cd5e1204
...
...
@@ -13,11 +13,6 @@
# limitations under the License.
# ==============================================================================
"""Utility helpers for Bert2Bert."""
from
__future__
import
absolute_import
from
__future__
import
division
# from __future__ import google_type_annotations
from
__future__
import
print_function
from
absl
import
logging
import
tensorflow
as
tf
from
typing
import
Optional
,
Text
...
...
official/nlp/transformer/attention_layer.py
浏览文件 @
cd5e1204
...
...
@@ -13,11 +13,6 @@
# limitations under the License.
# ==============================================================================
"""Implementation of multiheaded attention and self-attention layers."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
math
import
tensorflow
as
tf
...
...
official/nlp/transformer/compute_bleu.py
浏览文件 @
cd5e1204
...
...
@@ -18,10 +18,6 @@ Source:
https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/utils/bleu_hook.py
"""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
re
import
sys
import
unicodedata
...
...
official/nlp/transformer/data_download.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Download and preprocess WMT17 ende training and evaluation datasets."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
import
random
import
tarfile
...
...
official/nlp/transformer/data_pipeline.py
浏览文件 @
cd5e1204
...
...
@@ -47,10 +47,6 @@ Two things to note in the pipeline:
in the order of the examples.
"""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
from
absl
import
logging
...
...
official/nlp/transformer/embedding_layer.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Implementation of embedding layer with shared weights."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
tensorflow
as
tf
...
...
official/nlp/transformer/ffn_layer.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Implementation of fully connected network."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
tensorflow
as
tf
...
...
official/nlp/transformer/metrics.py
浏览文件 @
cd5e1204
...
...
@@ -22,9 +22,6 @@ Metrics:
- ROUGE score. Source:
https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/utils/rouge.py
"""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
functools
...
...
official/nlp/transformer/misc.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Misc for Transformer."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
# pylint: disable=g-bad-import-order
from
absl
import
flags
...
...
official/nlp/transformer/model_utils.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Transformer model helper methods."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
math
import
numpy
as
np
...
...
official/nlp/transformer/model_utils_test.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Test Transformer model helper methods."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
tensorflow
as
tf
from
official.nlp.transformer
import
model_utils
...
...
official/nlp/transformer/optimizer.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Optimizer from addons and learning rate scheduler."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
tensorflow
as
tf
...
...
official/nlp/transformer/transformer.py
浏览文件 @
cd5e1204
...
...
@@ -17,9 +17,6 @@
Model paper: https://arxiv.org/pdf/1706.03762.pdf
Transformer model code source: https://github.com/tensorflow/tensor2tensor
"""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
tensorflow
as
tf
from
official.nlp.modeling.layers
import
position_embedding
...
...
official/nlp/transformer/transformer_layers_test.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Tests for layers in Transformer."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
tensorflow
as
tf
from
official.nlp.transformer
import
attention_layer
...
...
official/nlp/transformer/transformer_main.py
浏览文件 @
cd5e1204
...
...
@@ -17,9 +17,6 @@
See README for description of setting the training schedule and evaluating the
BLEU score.
"""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
import
tempfile
...
...
official/nlp/transformer/transformer_main_test.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Test Transformer model."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
import
re
import
sys
...
...
official/nlp/transformer/transformer_test.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Test Transformer model."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
tensorflow
as
tf
from
official.nlp.transformer
import
model_params
...
...
official/nlp/transformer/translate.py
浏览文件 @
cd5e1204
...
...
@@ -14,10 +14,6 @@
# ==============================================================================
"""Translate text or files using trained transformer model."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
# Import libraries
from
absl
import
logging
import
numpy
as
np
...
...
official/nlp/xlnet/common_flags.py
浏览文件 @
cd5e1204
...
...
@@ -13,10 +13,6 @@
# limitations under the License.
# ==============================================================================
"""Common flags used in XLNet model."""
from
__future__
import
absolute_import
from
__future__
import
division
# from __future__ import google_type_annotations
from
__future__
import
print_function
from
absl
import
flags
...
...
official/nlp/xlnet/data_utils.py
浏览文件 @
cd5e1204
...
...
@@ -14,11 +14,6 @@
# ==============================================================================
"""Utilities used for data preparation."""
from
__future__
import
absolute_import
from
__future__
import
division
# from __future__ import google_type_annotations
from
__future__
import
print_function
import
collections
import
json
import
os
...
...
official/nlp/xlnet/optimization.py
浏览文件 @
cd5e1204
...
...
@@ -13,10 +13,6 @@
# limitations under the License.
# ==============================================================================
"""Functions and classes related to optimization (weight updates)."""
from
__future__
import
absolute_import
from
__future__
import
division
# from __future__ import google_type_annotations
from
__future__
import
print_function
from
absl
import
logging
import
tensorflow
as
tf
...
...
official/nlp/xlnet/preprocess_classification_data.py
浏览文件 @
cd5e1204
...
...
@@ -13,9 +13,6 @@
# limitations under the License.
# ==============================================================================
"""Script to pre-process classification data into tfrecords."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
collections
import
csv
...
...
official/nlp/xlnet/preprocess_pretrain_data.py
浏览文件 @
cd5e1204
...
...
@@ -15,10 +15,6 @@
# ==============================================================================
"""Script to pre-process pre-training data into tfrecords."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
json
import
os
import
random
...
...
official/nlp/xlnet/preprocess_squad_data.py
浏览文件 @
cd5e1204
...
...
@@ -14,9 +14,6 @@
# limitations under the License.
# ==============================================================================
"""Script to pre-process SQUAD data into tfrecords."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
import
random
...
...
official/nlp/xlnet/preprocess_utils.py
浏览文件 @
cd5e1204
...
...
@@ -14,9 +14,6 @@
# limitations under the License.
# ==============================================================================
"""Utilities for pre-processing."""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
unicodedata
import
six
...
...
official/nlp/xlnet/training_utils.py
浏览文件 @
cd5e1204
...
...
@@ -13,10 +13,6 @@
# limitations under the License.
# ==============================================================================
"""XLNet training utils."""
from
__future__
import
absolute_import
from
__future__
import
division
# from __future__ import google_type_annotations
from
__future__
import
print_function
import
os
import
re
...
...
official/nlp/xlnet/xlnet_config.py
浏览文件 @
cd5e1204
...
...
@@ -14,11 +14,6 @@
# ==============================================================================
"""Utility functions used in XLNet model."""
from
__future__
import
absolute_import
from
__future__
import
division
# from __future__ import google_type_annotations
from
__future__
import
print_function
import
json
import
os
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录