Spaces:
Running
Running
import sys | |
from huggingface_hub import InferenceClient | |
from aggile import Aggile, Graph | |
import streamlit as st | |
import os | |
st.title('AGGILE: Automated Graph Generation for Inference and Language Exploration') | |
text = st.text_area("Enter your text", "") | |
# Initialize Aggile with your HuggingFace credentials; change the model if needed | |
client = InferenceClient("deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", token=os.getenv('HF_TOKEN')) | |
aggile = Aggile(client=client) | |
# Form triplets from the text from string | |
triplets = aggile.form_triples(text) | |
# Visualize graph based on generated triplets | |
st.plotly_chart(Graph(triplets).build_graph()) # Saves and shows graph_with_predicates.html | |