Spaces:
Sleeping
Sleeping
File size: 1,611 Bytes
90d4aa5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
import numpy as np
import matplotlib.pyplot as plt
import random
import os
def random_plot():
start_year = 2020
x = np.arange(start_year, start_year + random.randint(0, 10))
year_count = x.shape[0]
plt_format = "-"
fig = plt.figure()
ax = fig.add_subplot(111)
series = np.arange(0, year_count, dtype=float)
series = series**2
series += np.random.rand(year_count)
ax.plot(x, series, plt_format)
return fig
img_dir = os.path.join(os.path.dirname(__file__), "files")
file_dir = os.path.join(os.path.dirname(__file__), "..", "kitchen_sink", "files")
model3d_dir = os.path.join(os.path.dirname(__file__), "..", "model3D", "files")
highlighted_text_output_1 = [
{
"entity": "I-LOC",
"score": 0.9988978,
"index": 2,
"word": "Chicago",
"start": 5,
"end": 12,
},
{
"entity": "I-MISC",
"score": 0.9958592,
"index": 5,
"word": "Pakistani",
"start": 22,
"end": 31,
},
]
highlighted_text_output_2 = [
{
"entity": "I-LOC",
"score": 0.9988978,
"index": 2,
"word": "Chicago",
"start": 5,
"end": 12,
},
{
"entity": "I-LOC",
"score": 0.9958592,
"index": 5,
"word": "Pakistan",
"start": 22,
"end": 30,
},
]
highlighted_text = "Does Chicago have any Pakistani restaurants"
def random_model3d():
model_3d = random.choice(
[os.path.join(model3d_dir, model) for model in os.listdir(model3d_dir) if model != "source.txt"]
)
return model_3d
|