A Hugging Face Space hosts and shares interactive machine-learning applications on the internet. It combines cloud deployment with a user-facing interface, making a model easier for others to try. section 10.3.12
A practical deployment path includes:
- Create a Hugging Face account and choose a Streamlit Space. section 10.3.12
- Clone the generated Git repository and edit its app.py file. section 10.3.12
- Connect the interface to a question-answering pipeline and display answers with their context. section 10.3.12
Interactive question-answering demo
A Streamlit Space can prompt for a question, echo the input for UX testing, then return an answer and supporting context. An example asks “Who invented sentiment analysis?” and returns “Hutto and Gilbert.” section 10.3.12
Listing 10.24 A “Hello World” QA application with Streamlit
>>> import streamlit as st
>>> st.title("Ask me about NLPiA!")
>>> st.markdown("Welcome to the official Question Answering webapp"
... "for _Natural Language Processing in Action, 2nd Ed_")
>>> question = st.text_input("Enter your question here:")
>>> if question:
... st.write(f"You asked: '{question}'")
Shows the minimal Streamlit interface for titling the app, accepting a question, and displaying the user’s input. section 10.3.12

