496. U.S. Patent Phrase to Phrase Matching | us-patent-phrase-to-phrase-matching
大家好,
首先,我要感谢 Satsyil Corp 和 Kaggle 团队组织了这样一场有趣且对初学者相对友好的竞赛,我学到了很多东西,特别是那些神奇的技巧。
这是我第一次认真参加的非表格数据竞赛(我之前只是随意地向 PetFinder 竞赛提交了一个复制的笔记本,所以我不把它算作第一次😜)。这也是我第一次接触 NLP。
当我看到我的排名从公共榜的铜牌区域上升到私有榜的银牌区域(跃升了 65 名)时,我感到非常高兴。
我想说,努力是有回报的💪。
作为我的第一次竞赛,我的主要关注点在于:
基本上,当我在试验各种 BERT 变体及其输入时,我总是保存它们的输出。
当我尝试各种集成技术时,感谢 @mobassir 在 这个帖子 中发布了 @cdeotte 大神的 集成技术。因此,我保留了那些有助于通过该技术增加相关性的模型,并丢弃了其他模型(公共 LB 0.8491)。
后来感谢 @gaozhao 发布了仅集成两个模型的 代码,其 LB 分数与我那 10 个模型的分数相同(0.8491)。从中我得到了使用 electra-large 作为骨干网络的想法,这帮助我达到了(LB 0.8504)。
由于评估指标是相关性,许多后处理技术并不能帮助提高 CV 分数。
后来,在阅读以前 NLP 竞赛的解决方案时,我了解到了 @takoihiraokazu 使用的 这项技术,即使用 Nelder-Mead 优化。
这是我使用的代码:
from scipy.optimize import minimize
def f(x):
pred1 = md.copy()
testy = md.copy()
pred1[testy >= 0.85] = testy[testy >= 0.85] * x[0]
pred1[(testy < 0.85) & (testy >= 0.75)
] = testy[(testy < 0.85) & (testy >= 0.75)] * x[1]
pred1[(testy < 0.75) & (testy >= 0.65)
] = testy[(testy < 0.75) & (testy >= 0.65)] * x[2]
pred1[(testy < 0.65) & (testy >= 0.5)
] = testy[(testy < 0.65) & (testy >= 0.5)] * x[3]
pred1[(testy < 0.5) & (testy >= 0.35)
] = testy[(testy < 0.5) & (testy >= 0.35)] * x[4]
pred1[(testy < 0.35) & (testy >= 0.25)
] = testy[(testy < 0.35) & (testy >= 0.25)] * x[5]
pred1[(testy < 0.25) & (testy >= 0.15)
] = testy[(testy < 0.25) & (testy >= 0.15)] * x[6]
pred1[(testy < 0.15