feat: try to get demo working after 2 years
This commit is contained in:
commit
8e2865c5ac
7 changed files with 1358 additions and 0 deletions
18
python3/salience/__init__.py
Normal file
18
python3/salience/__init__.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from flask import Flask
|
||||
import numpy as np
|
||||
from .salience import extract
|
||||
import json
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
with open('./transcript.txt', 'r') as file:
|
||||
source_text = file.read().strip()
|
||||
sentence_ranges, adjacency = extract(source_text)
|
||||
|
||||
@app.route("/salience")
|
||||
def salience_view():
|
||||
return json.dumps({
|
||||
'source': source_text,
|
||||
'intervals': sentence_ranges,
|
||||
'adjacency': np.nan_to_num(adjacency.numpy()).tolist(),
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue