mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
Summarizer angepasst
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
// Prepare output directory (always storage/transcriptionSummaries under project root)
|
// Prepare output directory (always storage/transcriptionSummaries under project root)
|
||||||
const outputDir = `${__dirname}/../../../storage/transcriptionSummaries`;
|
const outputDir = `${__dirname}/../../../storage/transcriptionSummaries`;
|
||||||
@@ -6,6 +7,7 @@ if (!fs.existsSync(outputDir)) {
|
|||||||
fs.mkdirSync(outputDir, { recursive: true });
|
fs.mkdirSync(outputDir, { recursive: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "summarize-transcription", // Unique name for our function that will later be used to get the function from the map via "mapFunctions.get("example").function()"
|
name: "summarize-transcription", // Unique name for our function that will later be used to get the function from the map via "mapFunctions.get("example").function()"
|
||||||
type: "summarizer", // value used to differentiate each module to order them in the UI
|
type: "summarizer", // value used to differentiate each module to order them in the UI
|
||||||
@@ -32,7 +34,8 @@ module.exports = {
|
|||||||
return { error: "Invalid JSON" };
|
return { error: "Invalid JSON" };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(inputJson);
|
// console.log(inputJson);
|
||||||
|
console.log(outputDir);
|
||||||
const words = inputJson.words;
|
const words = inputJson.words;
|
||||||
if (!Array.isArray(words)) {
|
if (!Array.isArray(words)) {
|
||||||
return { error: "No words Array found" };
|
return { error: "No words Array found" };
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const inputJson = JSON.parse(fs.readFileSync("./testFile.json", "utf8"));
|
|||||||
|
|
||||||
// Übergabe an den Summarizer
|
// Übergabe an den Summarizer
|
||||||
transSummarizer.function({
|
transSummarizer.function({
|
||||||
inputJson: inputJson
|
json: inputJson
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user