|
import numpy as np |
|
import matplotlib.pyplot as plt |
|
|
|
|
|
|
|
def linear_function(x): |
|
m = (4 - 1) / (1.5 - 1) |
|
b = 1 - m * 1 |
|
return m * x + b |
|
|
|
def quadratic_function(x): |
|
return -0.0816 * (x - 5) ** 2 + 5 |
|
|
|
|
|
def nat2avaMOS(x): |
|
if x <= 1.5: |
|
return linear_function(x) |
|
elif x >1.5 and x <= 5: |
|
return quadratic_function(x) |
|
|
|
|
|
def WER2INTELI(x): |
|
if x <= 10: |
|
return 100 |
|
elif x <= 100: |
|
slope = (30 - 100) / (100 - 10) |
|
intercept = 100 - slope * 10 |
|
return slope * x + intercept |
|
else: |
|
return 100 * np.exp(-0.01 * (x - 100)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x1 = np.linspace(1, 1.5, 100) |
|
x2 = np.linspace(1.5, 5, 100) |
|
|
|
|
|
y1 = linear_function(x1) |
|
y2 = quadratic_function(x2) |
|
|
|
|
|
plt.plot(x1, y1, label='Linear Function (1 <= x <= 1.5)') |
|
|
|
|
|
plt.plot(x2, y2, label='Quadratic Function (1.5 <= x <= 5)') |
|
|
|
|
|
plt.xlabel('Natural Mean Opinion Score') |
|
plt.ylabel('AVA Mean Opinion Score') |
|
plt.title('nat2avaMOS') |
|
|
|
|
|
plt.legend() |
|
|
|
|
|
plt.grid(True) |
|
|
|
|
|
plt.savefig("./local/nat2avaMOS.png") |
|
|