import gradio as gr from datasets import load_dataset # Load the dataset dataset = load_dataset("MohamedRashad/arabic-books") def filter_arabic_novels(): # Select only rows containing novel-like words filtered_data = dataset['train'].filter(lambda x: "رواية" in x['text']) return filtered_data # Function to display the first row text def get_first_text(): try: return dataset['train'][0]['text'] except Exception as e: return str(e) # Create a Gradio Interface interface = gr.Interface( fn=get_first_text, inputs=[], outputs="text", ) # Launch the interface interface.launch()