预测法语和英语食物描述的正确匹配

我有一组关于食物描述的培训和测试集(请参阅下面的示例) 一对姓氏是法语中的食物名称 第二个单词是这个食物的英文描述。 交易集还具有一个trans字段,该字段为True,表示正确的描述 False表示错误的描述。 任务是预测测试集中的trans字段,换句话说就是预测 食物描述是核心,这是错误的。

dishes = [{"fr":"Agneau de lait","eng":"Baby milk-fed lamb","trans": True},{"fr":"Agrume","eng":"Blackcurrants","trans": False},{"fr":"Algue","eng":"Buttermilk",{"fr":"Aligot","eng":"potatoes mashed with fresh mountain cheese",{"fr":"Baba au rhum","eng":"Star anise",{"fr":"Babeurre","eng":"seaweed",{"fr":"Badiane","eng":"Sponge cake (often soaked in rum)",{"fr":"Boeuf bourguignon","eng":"Créole curry",{"fr":"Carbonade flamande","eng":"Beef Stew",{"fr":"Cari","eng":"Beef stewed in red wine",{"fr":"Cassis","eng":"citrus",{"fr":"Cassoulet","eng":"Stew from the South-West of France",{"fr":"Céleri-rave","eng":"Celery root","trans": True}]

df = pd.DataFrame(dishes)

    fr                  eng                                          trans
0   Agneau de lait      Baby milk-fed lamb                           True
1   Agrume              Blackcurrants                                False
2   Algue               Buttermilk                                   False
3   Aligot              potatoes mashed with fresh mountain cheese   False
4   Baba au rhum        Star anise                                   True
5   Babeurre            seaweed                                      False
6   Badiane             Sponge cake (often soaked in rum)            False
7   Boeuf bourguignon   Créole curry                                 False
8   Carbonade flamande  Beef Stew                                    True
9   Cari                Beef stewed in red wine                      False
10  Cassis              citrus                                       False
11  Cassoulet           Stew from the South-West of France           True
12  Céleri-rave         Celery root                                  True

我认为这是作为文本分类问题来解决的,其中文本是法语名称和英语描述嵌入的串联。

问题:

  • 要使用哪些嵌入以及如何对其进行串联?
  • 关于解决此问题的其他想法吗? berT?

更新

以下方法如何?

  • 将法语名称翻译成berT(带berT?)
  • 使用嵌入来创建两个向量:v1-翻译的英语向量和v2-英语描述向量(来自数据集)
  • 计算v1-v2
  • 使用两列创建新数据集:v1 - v2trans
  • 在此新数据集上训练分类器

更新2:

跨语言分类可能是解决我的问题的正确方法:

https://github.com/facebookresearch/XLM#iv-applications-cross-lingual-text-classification-xnli

根据上面带有链接的页面上的描述,尚不清楚我的训练数据集的适合位置以及如何在测试集上运行分类器。请帮忙弄清楚这一点。最好找到跨语言分类的端到端示例/教程。

yuelao0308 回答:预测法语和英语食物描述的正确匹配

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2467808.html

大家都在问