WangZeJun

Results 62 comments of WangZeJun

> > > > 请详细说一下怎么操作可以吗?感谢! 对 田: ⿵⿰丨𠃌⿱⿻一丨一 和 由:⿻⿴⿱⿰丨𠃌一一丨 的 ids 先进行排序,再计算编辑距离

> 感谢分享。 请添加上OCNLI原项目链接:https://github.com/CLUEbenchmark/OCNLI 谢谢提醒,已添加在: 原生中文自然语言推理数据集 OCNLI,是第一个非翻译的、使用原生汉语的大型中文自然语言推理数据集。该数据集来自于中文语言理解测评基准 CLUE benchmark(https://github.com/CLUEbenchmark/OCNLI )

> 您好!请问怎么让模型输出更小的维度呢(比如64维)?768维在实际中占用空间太大,而且计算也比较耗时 bert4vec 支持加载的四个模型中,能输出的最小维度是 384,可以使用: model = Bert4Vec(mode='roformer-sim-small') model = Bert4Vec(mode='paraphrase-multilingual-minilm') 输出 384 维度的句向量。

bert4vec 是一个基于 transformers 的句向量推理工具,目前不支持使用数据集进行微调

这里的模型是苏神 roformer-sim 的原始版本,没有经过 finetune 的

> 您好,我看到原始的 SimBERT 和 RoFormer-Sim 模型是基于TensorFlow的,作者使用的什么方法做的? 我是将原始的模型权重转化为了 HuggingFace 支持的加载格式: https://huggingface.co/WangZeJun/simbert-base-chinese 原始模型介绍可参考: https://github.com/ZhuiyiTechnology/simbert

> 用 transformers 库中的 convert_bert_original_tf_checkpoint_to_pytorch.py 转的

> 使用readme中的例子 > > model1 = Bert4Vec(mode='roformer-sim-base') model2 = Bert4Vec(model_name_or_path='WangZeJun/roformer-sim-base-chinese') model3 = Bert4Vec(model_name_or_path='./roformer-sim-base-chinese') > > sent1 = ['喜欢打篮球的男生喜欢什么样的女生', '西安下雪了?是不是很冷啊?', '第一次去见女朋友父母该如何表现?', '小蝌蚪找妈妈怎么样', '给我推荐一款红色的车', '我喜欢北京', 'That is a happy person'] sent2 =...

> > 最近又检查了一下数字对不上的问题出在哪里,发现有两点: > > 1. 使用了mean pooling而不是CLS pooling > 2. 不应该在CLS embedding上再加tanh激活 > > 修复这两点以后,现在的实验数字就跟苏神汇报的一模一样了 > > https://github.com/blmoistawinde/bert4vec/blob/main/examples/compare_models.ipynb > > 另外,之前用bert的转换代码来转换roformer总是有点奇怪,所以自己研究了一下roformer的转换代码,也附在里面了 > > https://github.com/blmoistawinde/bert4vec/blob/main/examples/convert_roformer_sim_original_tf_checkpoint_to_pytorch.py 你好,我发现你提供的 roformer-ft 测试例子都是苏神原博客的几个例子,但我在下面数据上进行测试发现,roformer-ft 计算出来的相似度区分性不够: `queries...