How to train BART text summarization with your own data?
# ❓ Questions & Help

## Details
This is actually a two part question. I have noticed that in [1](https://github.com/huggingface/transformers/blob/master/examples/summarization/bart/run_train.sh) instructions have been given to train with the cnn/dm data. How would we train it with our own data? Should the file format be .story? 
And secondly how exactly do we handle the python path in google colab?

![image](https://user-images.githubusercontent.com/23182970/78650840-49d6a580-78e1-11ea-8796-d4267bf44714.png)

I have tried in both these ways and failed. 

Link to this question in SO: [2] (https://stackoverflow.com/questions/61058171/no-module-named-transformer-base/61070453#61070453)
You can try to move transformer_base file to the same location of run_bart_sum.py.<|||||>Hi,
1.  As written in `README.md`
> "To use your own data, copy that files format. Each article to be summarized is on its own line."

 I think you should insert in cnn_dm folder your files renamed `train.source`, `train.target`, `test.source`, `test.target`, `val.source`, `val.target`, where in each file you have respectively a source text and a target text per line.

2. You are not using the script  `run_train.sh`, as suggested in the `README.md`. In the `run_train.sh` there are a series of export commands that you missed. 
The last one should fix your issue.
Hope it helps.

 ```export OUTPUT_DIR_NAME=bart_sum
export CURRENT_DIR=${PWD}
export OUTPUT_DIR=${CURRENT_DIR}/${OUTPUT_DIR_NAME}

# Make output directory if it doesn't exist
mkdir -p $OUTPUT_DIR

#Add parent directory to python path to access transformer_base.py
export PYTHONPATH="../../":"${PYTHONPATH}"```

<|||||>Closing, @teelinsan 's answer is correct. 