ThilinaRajapakse / pytorch-transformers-classification

Based on the Pytorch-Transformers library by HuggingFace. To be used as a starting point for employing Transformer models in text classification tasks. Contains code to easily train BERT, XLNet, RoBERTa, and XLM models for text classification.
Apache License 2.0
306 stars 97 forks source link

task_name #12

Closed Magpi007 closed 5 years ago

Magpi007 commented 5 years ago

In the args dictionary we have this entry: 'task_name': 'binary',.

Later it is used in here:

task = args['task_name']
processor = processors[task]()

I have tried to change this name (i.e. yelp) but it gives me an error (not too much info in the error, it only shows the name of the task I wrote). With binary works well. Is it the name for the task (i.e. a description) or maybe the type of text classification task?

ThilinaRajapakse commented 5 years ago

It's basically the name of the task you are doing that is used to get the following information.

processors = {
    "binary": BinaryProcessor
}

output_modes = {
    "binary": "classification"
}

These are defined in utils.py. It's only useful when you want to reuse the code for multiple tasks, for example by writing your own DataProcessor. But yes, it's too cryptic. The error message should be clearer at the very least.

Magpi007 commented 5 years ago

Ok, it's clear. Thanks.