import matplotlib.pyplot as plt
import numpy as np
x = np.arange(10)
fig = plt.figure()
ax = plt.subplot(111)
for i in xrange(5):
ax.plot(x, i * x, label='$y = %ix$' % i)
ax.legend(bbox_to_anchor=(1.1, 1.05))
plt.show()
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,我遇到了将图例置于任意位置的函数 bbox_to_anchor 。我无法理解该函数的前两个参数,所有文献都说是归一化轴参数。任何机构都可以解释它们是什么以及如何操纵它们吗?
我使用tokenizer = RobertaTokenizerFast.from_pretrained('roberta-base',add_prefix_space=True)在英语数据上训练的 roberta-base 分词器来对孟加拉语进行分词,只是为了看看它的行为如何。当我尝试对孟加拉语字符进行编码时tokenizer.encode('\xe0\xa6\xac\xe0\xa6\xbe'),我得到[0, 1437, 35861, 11582, 35861, 4726, 2]的结果是,即使在英语上进行训练,它也会在词汇表中找到一些与孟加拉语字符匹配的标记。经过进一步探索,我发现这些都是特殊字符['<s>', '\xc4\xa0', '\xc3\xa0\xc2\xa6', '\xc2\xac', '\xc3\xa0\xc2\xa6', '\xc2\xbe', '</s>']。我的问题是为什么会发生这种情况,当应用于新语言时,它不应该输出未知的标记吗?非常感谢任何帮助
huggingface-transformers huggingface-tokenizers roberta-language-model