KevinGeng commited on
Commit
5935249
1 Parent(s): 15263a7

change nat2AVAMOS

Browse files
Files changed (2) hide show
  1. local/convert_metrics.py +27 -25
  2. local/nat2avaMOS.png +0 -0
local/convert_metrics.py CHANGED
@@ -4,7 +4,9 @@ import matplotlib.pyplot as plt
4
  # Natural MOS to AVA MOS
5
 
6
  def linear_function(x):
7
- return 8 * x - 8
 
 
8
 
9
  def quadratic_function(x):
10
  return -0.0816 * (x - 5) ** 2 + 5
@@ -27,13 +29,13 @@ def WER2INTELI(x):
27
  else:
28
  return 100 * np.exp(-0.01 * (x - 100))
29
 
30
- # # 生成 x 值
31
  # x = np.linspace(0, 200, 400) # 从0到200生成400个点
32
 
33
- # # 计算对应的 y 值
34
- # y = [WER2INT(xi) for xi in x]
 
35
 
36
- # # 绘制函数图像
37
  # plt.plot(x, y)
38
  # plt.xlabel('x')
39
  # plt.ylabel('f(x)')
@@ -41,31 +43,31 @@ def WER2INTELI(x):
41
  # plt.grid(True)
42
  # plt.show()
43
 
44
- # # 生成 x 值的范围
45
- # x1 = np.linspace(1, 1.5, 100)
46
- # x2 = np.linspace(1.5, 5, 100)
47
 
48
- # # 计算对应的 y 值
49
- # y1 = linear_function(x1)
50
- # y2 = quadratic_function(x2)
51
 
52
- # # 绘制线性部分
53
- # plt.plot(x1, y1, label='Linear Function (1 <= x <= 1.5)')
54
 
55
- # # 绘制二次部分
56
- # plt.plot(x2, y2, label='Quadratic Function (1.5 <= x <= 5)')
57
 
58
- # # 添加标签和标题
59
- # plt.xlabel('Natural Mean Opinion Score')
60
- # plt.ylabel('AVA Mean Opinion Score')
61
- # plt.title('nat2avaMOS')
62
 
63
- # # 添加图例
64
- # plt.legend()
65
 
66
- # # 显示图形
67
- # plt.grid(True)
68
 
69
- # # 显示图像
70
- # plt.savefig("./local/nat2avaMOS.png")
71
  # plt.savefig("./local/WER2INT.png")
 
4
  # Natural MOS to AVA MOS
5
 
6
  def linear_function(x):
7
+ m = (4 - 1) / (1.5 - 1)
8
+ b = 1 - m * 1
9
+ return m * x + b
10
 
11
  def quadratic_function(x):
12
  return -0.0816 * (x - 5) ** 2 + 5
 
29
  else:
30
  return 100 * np.exp(-0.01 * (x - 100))
31
 
32
+ # 生成 x 值
33
  # x = np.linspace(0, 200, 400) # 从0到200生成400个点
34
 
35
+ # 计算对应的 y 值
36
+ # y = [WER2INTELI(xi) for xi in x]
37
+
38
 
 
39
  # plt.plot(x, y)
40
  # plt.xlabel('x')
41
  # plt.ylabel('f(x)')
 
43
  # plt.grid(True)
44
  # plt.show()
45
 
46
+ # 生成 x 值的范围
47
+ x1 = np.linspace(1, 1.5, 100)
48
+ x2 = np.linspace(1.5, 5, 100)
49
 
50
+ # 计算对应的 y 值
51
+ y1 = linear_function(x1)
52
+ y2 = quadratic_function(x2)
53
 
54
+ # 绘制线性部分
55
+ plt.plot(x1, y1, label='Linear Function (1 <= x <= 1.5)')
56
 
57
+ # 绘制二次部分
58
+ plt.plot(x2, y2, label='Quadratic Function (1.5 <= x <= 5)')
59
 
60
+ # 添加标签和标题
61
+ plt.xlabel('Natural Mean Opinion Score')
62
+ plt.ylabel('AVA Mean Opinion Score')
63
+ plt.title('nat2avaMOS')
64
 
65
+ # 添加图例
66
+ plt.legend()
67
 
68
+ # 显示图形
69
+ plt.grid(True)
70
 
71
+ # 显示图像
72
+ plt.savefig("./local/nat2avaMOS.png")
73
  # plt.savefig("./local/WER2INT.png")
local/nat2avaMOS.png CHANGED