feat: try to get demo working after 2 years

This commit is contained in:
nobody 2025-10-30 14:16:04 -07:00
commit 8e2865c5ac
Signed by: GrocerPublishAgent
GPG key ID: D460CD54A9E3AB86
7 changed files with 1358 additions and 0 deletions

View 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(),
})