| import gradio as gr |
| import time |
|
|
| def patsnap_assistant(domain, query): |
| if not query: |
| yield "β οΈ Please enter keywords first.", "" |
| return |
|
|
| yield f"π Initializing PatSnap {domain} Engine...", "" |
| time.sleep(1) |
| |
| if domain == "βοΈ IP & Innovation Intelligence": |
| yield "π Retrieving global patent databases...", "### Analyzing: " + query |
| time.sleep(1.5) |
| result = f""" |
| ## βοΈ IP Insight Report: {query} |
| |
| ### 1. Patent Landscape |
| - **Core Technology**: Analysis shows a high concentration in the fusion of high-precision sensors and AI algorithms. |
| - **Key Assignees**: Identified 3 major industry leaders and 5 high-growth startups. |
| |
| ### 2. Innovation Risk (FTO Check) |
| - **Risk Assessment**: Preliminary scan found no direct infringement risks, but 2 patent families published in 2024 require monitoring. |
| |
| ### 3. Strategic Recommendations |
| - Recommended to prioritize **Path B (Modular Integration)**, as the patent barriers are relatively lower in this direction. |
| """ |
| yield "β
Analysis Complete!", result |
| |
| else: |
| yield "𧬠Retrieving biomedical and clinical trial data...", "### Analyzing: " + query |
| time.sleep(1.5) |
| result = f""" |
| ## 𧬠Life Sciences Research Report: {query} |
| |
| ### 1. Biomarker Investigation |
| - **Diagnostic Markers**: Identified 4 protein indicators highly correlated with this condition. |
| - **Clinical Value**: Predictive accuracy reported at over 85% in the latest literature. |
| |
| ### 2. R&D Pipeline |
| - **Drugs in Development**: Currently 12 related drugs are in Clinical Phase II globally. |
| - **Competitive Landscape**: Leading pharmaceutical companies have already established multi-target combination therapies. |
| |
| ### 3. Expert Recommendations |
| - Suggest focusing on the development of **Predictive Biomarkers** to improve patient stratification efficiency in clinical trials. |
| """ |
| yield "β
Analysis Complete!", result |
|
|
| |
| custom_css = """ |
| #title { text-align: center; color: #1a73e8; margin-bottom: 20px; } |
| .feedback { font-weight: bold; color: #1a73e8; } |
| """ |
|
|
| |
| with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="PatSnap Intelligence Assistant") as demo: |
| gr.Markdown("# 𧬠PatSnap Intelligence Assistant", elem_id="title") |
| gr.Markdown("Experience the power of PatSnap AI Agent Skills. Select a domain and enter your keywords.") |
| |
| with gr.Row(): |
| with gr.Column(scale=1): |
| domain_input = gr.Radio( |
| choices=["βοΈ IP & Innovation Intelligence", "𧬠Life Sciences & Pharma"], |
| label="Select Intelligence Domain", |
| value="βοΈ IP & Innovation Intelligence" |
| ) |
| query_input = gr.Textbox( |
| label="Keywords (e.g., 'Solid-state battery' or 'EGFR Inhibitors')", |
| placeholder="Enter keywords here..." |
| ) |
| submit_btn = gr.Button("Start Intelligence Analysis", variant="primary") |
| |
| with gr.Column(scale=2): |
| |
| status_output = gr.Markdown("Waiting for input...", elem_classes="feedback") |
| result_output = gr.Markdown("Analysis results will appear here.") |
|
|
| submit_btn.click( |
| fn=patsnap_assistant, |
| inputs=[domain_input, query_input], |
| outputs=[status_output, result_output] |
| ) |
|
|
| demo.launch() |
|
|