Skip to content
Snippets Groups Projects
Commit 612094e8 authored by zehe's avatar zehe
Browse files

add openai requirement

parent 7511cfcf
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,7 @@ setup( ...@@ -15,6 +15,7 @@ setup(
install_requires=[ # I get to this in a second install_requires=[ # I get to this in a second
"wuenlp @ git+https://gitlab2.informatik.uni-wuerzburg.de/kallimachos/wuenlp", "wuenlp @ git+https://gitlab2.informatik.uni-wuerzburg.de/kallimachos/wuenlp",
"plotly", "plotly",
"openai",
], ],
classifiers=[ classifiers=[
'Development Status :: 3 - Alpha', 'Development Status :: 3 - Alpha',
......
...@@ -9,6 +9,9 @@ from wuenlp.impl.UIMANLPStructs import UIMADocument, UIMAAnnotation, UIMASystemS ...@@ -9,6 +9,9 @@ from wuenlp.impl.UIMANLPStructs import UIMADocument, UIMAAnnotation, UIMASystemS
# Function to format text with newlines # Function to format text with newlines
from utils.summarize import summarize_doc
def format_text(text, line_length=20, max_lines=75): def format_text(text, line_length=20, max_lines=75):
# Split long texts into lines # Split long texts into lines
split = text.split(" ") split = text.split(" ")
...@@ -32,8 +35,7 @@ def plot_sentiment_interactive(doc: UIMADocument, segment_type: Type[UIMAAnnotat ...@@ -32,8 +35,7 @@ def plot_sentiment_interactive(doc: UIMADocument, segment_type: Type[UIMAAnnotat
raise ValueError(f"No {segment_type.__name__} found in {doc.path.stem}") raise ValueError(f"No {segment_type.__name__} found in {doc.path.stem}")
if call_summarizer_if_necessary and not segments[0].additional_features.get('llama_summary', None): if call_summarizer_if_necessary and not segments[0].additional_features.get('llama_summary', None):
raise NotImplementedError("Summarizer not implemented") doc = summarize_doc(doc, segment_type=segment_type)
# doc = summarize_doc(doc, segment_type=segment_type)
# Extracting scenes (assuming 'document' is UIMADocument and has a method to get system scenes) # Extracting scenes (assuming 'document' is UIMADocument and has a method to get system scenes)
for segment in segments: for segment in segments:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment