You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

evaluation_config.py 1.7 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Copyright 2020 Huawei Technologies Co., Ltd
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. # ============================================================================
  15. """
  16. config settings, will be used in finetune.py
  17. """
  18. from easydict import EasyDict as edict
  19. import mindspore.common.dtype as mstype
  20. from mindspore.model_zoo.Bert_NEZHA import BertConfig
  21. cfg = edict({
  22. 'task': 'NER',
  23. 'num_labels': 41,
  24. 'data_file': '/your/path/evaluation.tfrecord',
  25. 'schema_file': '/your/path/schema.json',
  26. 'finetune_ckpt': '/your/path/your.ckpt',
  27. 'use_crf': False,
  28. 'clue_benchmark': False,
  29. })
  30. bert_net_cfg = BertConfig(
  31. batch_size=16 if not cfg.clue_benchmark else 1,
  32. seq_length=128,
  33. vocab_size=21128,
  34. hidden_size=768,
  35. num_hidden_layers=12,
  36. num_attention_heads=12,
  37. intermediate_size=3072,
  38. hidden_act="gelu",
  39. hidden_dropout_prob=0.0,
  40. attention_probs_dropout_prob=0.0,
  41. max_position_embeddings=512,
  42. type_vocab_size=2,
  43. initializer_range=0.02,
  44. use_relative_positions=False,
  45. input_mask_from_dataset=True,
  46. token_type_ids_from_dataset=True,
  47. dtype=mstype.float32,
  48. compute_type=mstype.float16,
  49. )