File size: 6,422 Bytes
0c1c3d2
ce75d5d
 
 
0c1c3d2
ce75d5d
 
0c1c3d2
ce75d5d
 
 
 
 
 
 
 
40ad1c9
ce75d5d
 
40ad1c9
 
ce75d5d
 
 
 
 
 
 
9903d83
40ad1c9
ce75d5d
 
9903d83
40ad1c9
 
ce75d5d
0eeff55
83bf936
 
 
 
 
 
 
 
9903d83
 
 
83bf936
0eeff55
 
 
 
 
 
83bf936
 
 
e903908
 
7e32308
cc3515d
83bf936
 
 
 
0eeff55
 
 
ce75d5d
40ad1c9
6205b11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import gradio as gr
import onnxruntime as rt
from transformers import AutoTokenizer
import torch, json

# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("allenai/scibert_scivocab_uncased")

# Load encoded subject dictionary
with open("subject_types_encoded.json", "r") as fp:
    encode_subject_types = json.load(fp)

subjects = list(encode_subject_types.keys())

# Load ONNX model
inf_session = rt.InferenceSession("Scientific Articles-classifier-quantized.onnx")
input_name = inf_session.get_inputs()[0].name
output_name = inf_session.get_outputs()[0].name

# Prediction function
def classify_subjects(abstract: str):
    inputs = tokenizer(
        abstract,
        padding="max_length",
        truncation=True,
        max_length=512,
        return_tensors="np"
    )

    logits = inf_session.run([output_name], {input_name: inputs["input_ids"]})[0]
    logits = torch.FloatTensor(logits)
    probs = torch.sigmoid(logits)[0]

    # Return dictionary of all subjects with probabilities
    return dict(zip(subjects, map(float, probs)))

# --- Gradio 5.49.0 compatible interface ---
with gr.Blocks(theme="gradio/soft") as iface:
    gr.Markdown("## 🧠 Computer Science Research Article Subject Classifier")
    gr.Markdown(
        "This demo uses a SciBERT-based ONNX model to predict the top subject "
        "categories from computer science research paper abstracts."
    )

    abstract_input = gr.Textbox(
        lines=6,
        placeholder="Enter research paper abstract here...",
        label="Research Abstract"
    )

    with gr.Row():
        clear_btn = gr.Button("Clear")
        submit_btn = gr.Button("Submit", variant="primary")

    output_label = gr.Label(num_top_classes=5, label="Output")

    gr.Examples(
        examples=[
        ["Human smuggling networks are complex and constantly evolving, making them difficult to analyze comprehensively. Legal case documents offer rich factual and procedural insights into these networks but are often long, unstructured, and filled with ambiguous or shifting references, posing significant challenges for automated knowledge graph (KG) construction. Existing methods either overlook coreference resolution or fail to scale beyond short text spans, leading to fragmented graphs and inconsistent entity linking. We propose LINK-KG, a modular framework that integrates a three-stage, LLM-guided coreference resolution pipeline with downstream KG extraction. At the core of our approach is a type-specific Prompt Cache, which consistently tracks and resolves references across document chunks, enabling clean and disambiguated narratives for structured knowledge graph construction from both short and long legal texts. LINK-KG reduces average node duplication by 45.21% and noisy nodes by 32.22% compared to baseline methods, resulting in cleaner and more coherent graph structures. These improvements establish LINK-KG as a strong foundation for analyzing complex criminal networks."],
        ["A world model is an internal model that simulates how the world evolves. Given past observations and actions, it predicts the future of both the embodied agent and its environment. Accurate world models are essential for enabling agents to think, plan, and reason effectively in complex, dynamic settings. Despite rapid progress, current world models remain brittle and degrade over long horizons. We argue that a central cause is representation quality: exteroceptive inputs (e.g., images) are high-dimensional, and lossy or entangled latents make dynamics learning unnecessarily hard. We therefore ask whether improving representation learning alone can substantially improve world-model performance. In this work, we take a step toward building a truly accurate world model by addressing a fundamental yet open problem: constructing a model that can fully clone and overfit to a deterministic 3D world. We propose Geometrically-Regularized World Models (GRWM), which enforces that consecutive points along a natural sensory trajectory remain close in latent representation space. This approach yields significantly improved latent representations that align closely with the true topology of the environment. GRWM is plug-and-play, requires only minimal architectural modification, scales with trajectory length, and is compatible with diverse latent generative backbones. Across deterministic 3D settings and long-horizon prediction tasks, GRWM significantly increases rollout fidelity and stability. Analyses show that its benefits stem from learning a latent manifold with superior geometric structure. These findings support a clear takeaway: improving representation learning is a direct and useful path to robust world models, delivering reliable long-horizon predictions without enlarging the dynamics module."],
        ["There are two prevalent ways to constructing 3D scenes: procedural generation and 2D lifting. Among them, panorama-based 2D lifting has emerged as a promising technique, leveraging powerful 2D generative priors to produce immersive, realistic, and diverse 3D environments. In this work, we advance this technique to generate graphics-ready 3D scenes suitable for physically based rendering (PBR), relighting, and simulation. Our key insight is to repurpose 2D generative models for panoramic perception of geometry, textures, and PBR materials. Unlike existing 2D lifting approaches that emphasize appearance generation and ignore the perception of intrinsic properties, we present OmniX, a versatile and unified framework. Based on a lightweight and efficient cross-modal adapter structure, OmniX reuses 2D generative priors for a broad range of panoramic vision tasks, including panoramic perception, generation, and completion. Furthermore, we construct a large-scale synthetic panorama dataset containing high-quality multimodal panoramas from diverse indoor and outdoor scenes. Extensive experiments demonstrate the effectiveness of our model in panoramic visual perception and graphics-ready 3D scene generation, opening new possibilities for immersive and physically realistic virtual world generation."]    
    ],
        inputs=[abstract_input],
        label="📘 Example Abstracts"
    )

    # Button logic
    submit_btn.click(fn=classify_subjects, inputs=abstract_input, outputs=output_label)
    clear_btn.click(lambda: "", outputs=abstract_input)

# Launch app
iface.launch(inline=False)