Yan Yuanmeng

Results 39 comments of Yan Yuanmeng

Thanks for your reply! I have proposed a PR #105 that simply removes the above-mentioned two lines.

此前也有尝试过将STS语料上fine-tune的BERT模型进一步在GLUE的各个下游任务上做有监督fine-tune测效果,但感觉没有很显著的性能提升;还尝试过利用GLUE下游任务上的无监督语料做训练,但这样也有个问题,就是缺乏dev集来判断句子表示的质量。我的感觉是纯对比的自监督目标可能还是更适合STS任务,因为两者的任务形式天然就很相近。如果用于其他任务,感觉对比损失还是更适合作为一个辅助目标。

看报错应该是没有运行repo下的transformers包,而是用安装的site-packages下的transformers包,可以试试把site-packages下的transformers包删除(pip uninstall transformers),或者手动把目前安装的transformers包的modeling_bert.py文件用repo下的版本(https://github.com/yym6472/ConSERT/blob/master/transformers/modeling_bert.py)替换

因为涉及到embedding层的数据增强,所以需要改动transformers里BERT forward内部的代码,目前还没想好怎么能不改动官方的package去实现这一点

From the error message, it seems that the `transformers` and `sentence_transformers` packages used by your code are the ones installed in the python library (site-packages), rather than the modified version...

你好,中文有监督训练因为不是之前的工作重心,所以我们还没进行过相关的实验。目前的代码也还需要做一些更改才能跑起来,同时一些模型超参、使用何种损失效果最好也需要做一些探索(我会在这周末尽快更新、做一些实验)。 如果你想尽快跑起来中文数据集的有监督训练,可以对代码做以下更改: 1. 如下更改[data_utils.py的第231-235行](https://github.com/yym6472/ConSERT/blob/master/data_utils.py#L231): ```python if split == "train": all_samples.append(InputExample(texts=[sent1, sent2], label=int(label))) else: all_samples.append(InputExample(texts=[sent1, sent2], label=float(label))) ``` 2. 更改`main.py`的[第203行](https://github.com/yym6472/ConSERT/blob/master/main.py#L203)和[第277行](https://github.com/yym6472/ConSERT/blob/master/main.py#L277),去掉第三个参数(表示使用全数据集做训练和验证): ```python train_samples = load_chinese_tsv_data(args.chinese_dataset, "train") ``` ```python dev_samples = load_chinese_tsv_data(args.chinese_dataset, "dev")...

> 您好,请问这样修改后是按照论文里面哪种联合模式进行训练,体现在代码哪个地方?还是说变成使用传统交叉熵的训练方式(只使用AdvCLoftmaxLoss.py代码里面371行,而没有其他联合信息)? 是的,这样就只是传统交叉熵损失训练。

@HL0718 在main.py里把num_classes改成6,因为STSB包含0~5的评分,而其他的数据集基本都是二分类(0或者1)。

@HL0718 说错了,是num_labels,在[254-265行](https://github.com/yym6472/ConSERT/blob/master/main.py#L254)

Hi, I don't know where do you get your dataset files, but we obtain all STS datasets through the [SentEval toolkit](https://github.com/facebookresearch/SentEval), and you can also download them using the script...