My team looked through the documentation for sentic_gcn as we are trying to make use of it to implement our sentiment analysis solution. However, we are unable to figure out how to train the model. Where do we input our own dataset into the model and are there any documentation on the steps required to achieve this?
Hi,
The documentation to train the SenticGCN model can be found here,
https://sgnlp.aisingapore.net/docs/model/senticgcn.html#training
First, make sure your datasets are in the same format here,
https://github.com/BinLiang-NLP/Sentic-GCN/tree/main/datasets/semeval14
Next, download a copy of the config file here, and replace the path to your datasets,
Lastly, follow the example code from the documentation here to start training, the train script will pick up the dataset based on the path defined in the config file,
https://sgnlp.aisingapore.net/docs/model/senticgcn.html#running-train-code
Hope this helps.
All things NLP
Could you kindly share the code and/or command you called to start the training?
As the training is able to start but with the wrong dataset used, it usually indicates that the wrong config file was parsed by the trainer.
Alternatively, you might wish to debug the trainer and place a breakpoint at the following and check if the `cfg` object is indeed pointing to the dataset file you have indicated in your config file.
https://github.com/aisingapore/sgnlp/blob/main/sgnlp/models/sentic_gcn/train.py#L590
Hope this helps.
All things NLP
Hi Raymond,
Sorry for the late reply. The link to our GitHub repository is attached here.
https://github.com/Merrickneo/GlowGuide
The Config file is in the config folder and the dataset we used is named black_honey_clean.raw.
We used the template as shown on the senticgcn website to train but it only loads their restaurant dataset.
My apologies for the confusing documentation, we will try to improve the clarity for the next release.
The training code stated in the documentation is meant to be called with a `--config` argument flag and it is meant for users which would like to have the option to override the original training code.
If you have installed the `sgnlp` package via `pip install sgnlp`. You can actually call the train code directly from your environment as follows,
```
python -m sgnlp.models.sentic_gcn.train --config /Users/merrick/Documents/AISG Hackathon/GlowGuide/config/sentic_gcn_bert_config.json
```
If you are running the training script from a cloned SGnlp repository, you can directly call the `train.py` script inside the `sgnlp/models/sentic_gcn/` folder, it will pick up the default config file as indicated here,
https://github.com/aisingapore/sgnlp/blob/main/sgnlp/models/sentic_gcn/utils.py#L25
You can also indicate a different config file location via the `--config` flag when calling the `train.py` directly.
```
python sgnlp/models/sentic_gcn/train.py --config
/Users/merrick/Documents/AISG Hackathon/GlowGuide/config/sentic_gcn_bert_config.json
```
Hope this helps.
All things NLP
Sorry there is a typo with the above instructions, when running the train code from the `train.py` file directly, please first navigate to the `sgnlp/models/` folder, then execute the training code,
```
python -m sentic_gcn.train --config /Users/merrick/Documents/AISG Hackathon/GlowGuide/config/sentic_gcn_bert_config.json
```
All things NLP