Git Product home page Git Product logo

Comments (6)

ymcui avatar ymcui commented on May 24, 2024

here it is.
https://github.com/ymcui/Chinese-BERT-wwm/tree/master/data/chnsenticorp

from chinese-xlnet.

allenyummy avatar allenyummy commented on May 24, 2024

以下是您提供的腳本參數,想詢問如何讓模型產出 dev.tsv 和 test.tsv 呢?
似乎沒有特別預測哪個檔案

XLNET_DIR=YOUR_GS_BUCKET_PATH_TO_XLNET
MODEL_DIR=YOUR_OUTPUT_MODEL_PATH
DATA_DIR=YOUR_DATA_DIR_TO_TFRECORDS
RAW_DIR=YOUR_RAW_DATA_DIR
TPU_NAME=v2-xlnet
TPU_ZONE=us-central1-b

python -u run_classifier.py \
	--spiece_model_file=./spiece.model \
	--model_config_path=${XLNET_DIR}/xlnet_config.json \
	--init_checkpoint=${XLNET_DIR}/xlnet_model.ckpt \
	--task_name=csc \
	--do_train=True \
	--do_eval=True \
	--eval_all_ckpt=False \
	--uncased=False \
	--data_dir=${RAW_DIR} \
	--output_dir=${DATA_DIR} \
	--model_dir=${MODEL_DIR} \
	--train_batch_size=48 \
	--eval_batch_size=48 \
	--num_hosts=1 \
	--num_core_per_host=8 \
	--num_train_epochs=3 \
	--max_seq_length=256 \
	--learning_rate=2e-5 \
	--save_steps=5000 \
	--use_tpu=True \
	--tpu=${TPU_NAME} \
	--tpu_zone=${TPU_ZONE}

from chinese-xlnet.

ymcui avatar ymcui commented on May 24, 2024

run_classifier.py里有CSCProcessor,你可以看一下,会自动读取dev/test

from chinese-xlnet.

allenyummy avatar allenyummy commented on May 24, 2024

以這個為例,產出檔案則為dev.tsv
若要產出test.tsv,則要在set_type那裏做修正
這樣理解對嗎?
感謝!

def get_devtest_examples(self, data_dir, set_type="dev"):
    input_file = os.path.join(data_dir, set_type+".tsv")
    tf.logging.info("using file %s" % input_file)
    lines = self._read_tsv(input_file)
    examples = []
    for (i, line) in enumerate(lines):
      if i == 0:
        continue
      guid = "%s-%s" % (set_type, i)

      text_a = line[1]
      label = line[0]
    
      examples.append(
          InputExample(guid=guid, text_a=text_a, text_b=None, label=label))
    return examples

from chinese-xlnet.

ymcui avatar ymcui commented on May 24, 2024

对的,在调用get_devtest_examples时传入set_type="dev"或者"test"

from chinese-xlnet.

allenyummy avatar allenyummy commented on May 24, 2024

十分感謝!

from chinese-xlnet.

Related Issues (20)

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.