Spaces:
Sleeping
Sleeping
File size: 681 Bytes
14357d2 2e46052 14357d2 c13b79e 14357d2 2e46052 14357d2 96c5059 14357d2 5b097a8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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
|