|
|
@ -62,6 +62,13 @@ CREATE TABLE buscribe_line_speakers
|
|
|
|
PRIMARY KEY (line, speaker, verifier)
|
|
|
|
PRIMARY KEY (line, speaker, verifier)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE buscribe_line_inferred_speakers
|
|
|
|
|
|
|
|
(
|
|
|
|
|
|
|
|
line BIGINT NOT NULL REFERENCES buscribe_transcriptions,
|
|
|
|
|
|
|
|
speaker BIGINT NOT NULL REFERENCES buscribe_speakers,
|
|
|
|
|
|
|
|
PRIMARY KEY (line, speaker)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE buscribe_verified_lines
|
|
|
|
CREATE TABLE buscribe_verified_lines
|
|
|
|
(
|
|
|
|
(
|
|
|
|
-- id BIGSERIAL PRIMARY KEY,
|
|
|
|
-- id BIGSERIAL PRIMARY KEY,
|
|
|
@ -107,12 +114,18 @@ SELECT id,
|
|
|
|
start_time,
|
|
|
|
start_time,
|
|
|
|
end_time,
|
|
|
|
end_time,
|
|
|
|
null AS verifier,
|
|
|
|
null AS verifier,
|
|
|
|
null AS names,
|
|
|
|
names,
|
|
|
|
transcription_line,
|
|
|
|
transcription_line,
|
|
|
|
to_tsvector('english', transcription_line) AS transcription_line_ts,
|
|
|
|
to_tsvector('english', transcription_line) AS transcription_line_ts,
|
|
|
|
null AS names_ts,
|
|
|
|
null AS names_ts,
|
|
|
|
transcription_json
|
|
|
|
transcription_json
|
|
|
|
FROM buscribe_transcriptions;
|
|
|
|
FROM buscribe_transcriptions
|
|
|
|
|
|
|
|
LEFT OUTER JOIN (
|
|
|
|
|
|
|
|
SELECT line, array_agg(name) AS names
|
|
|
|
|
|
|
|
FROM buscribe_line_inferred_speakers
|
|
|
|
|
|
|
|
INNER JOIN buscribe_speakers ON buscribe_line_inferred_speakers.speaker = buscribe_speakers.id
|
|
|
|
|
|
|
|
GROUP BY line
|
|
|
|
|
|
|
|
) AS speakers ON id = speakers.line;
|
|
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
ROLLBACK;
|
|
|
|
|
|
|
|
|
|
|
|