badalprasadsingh's picture
Update app.py
6929a81 verified
raw
history blame contribute delete
694 Bytes
# import gradio as gr
# gr.load("models/Clinical-AI-Apollo/Medical-NER").launch()
import streamlit as st
from transformers import pipeline
pipe = pipeline("ner", model="Clinical-AI-Apollo/Medical-NER")
def main():
text_input = st.text_area("Enter text:")
if text_input:
if text_input.strip() != "":
# Perform NER on the input text
entities = pipe(text_input)
st.write("Entities:")
for entity in entities:
st.write(f"- Entity: {entity['word']}, Type: {entity['entity']}")
else:
st.write("Please enter some text to extract entities.")
if __name__ == "__main__":
main()
pipe = pipeline()