Intermediate AI Projects
Intermediate AI projects use code to build something that runs on its own: a retrieval app, a classifier, a recommender. They use the skills from the building chapters of this course (Python, model APIs, embeddings, RAG and evaluation) and they end with a measured result on data the system never saw. Each project has a "done when" check: a concrete result you can show, not just "it works".
The Projects
| Project | Done when |
|---|---|
| Customer feedback analyzer | 100 comments are classified by theme and sentiment, with accuracy checked on 20 by hand |
| AI-powered knowledge assistant | It answers from a document collection and shows its sources |
| Document-based RAG application | An evaluation set of 30 questions has a measured score; see "Building a RAG Pipeline" |
| Product recommendation prototype | Recommendations come from embeddings and are explained for three users; see "Semantic Search" |
| Support ticket classifier | A precision and recall report on held-out tickets |
Example: A Support Ticket Classifier
This program builds the last project at small scale: made-up support tickets for a school's parent portal, sorted into billing, login, schedule and other, with a report on 60 held-out tickets.
import random
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import classification_report
# Made-up support tickets for a school's parent portal, built from phrases with some overlap between kinds
PHRASES = {
"billing": ["I was charged twice", "my card payment failed", "the fee amount looks wrong", "I need a receipt",
"refund for the canceled trip", "why is there a late fee"],
"login": ["I can't log in", "password reset email never came", "my account is locked",
"the portal says wrong password", "two-step code not arriving"],
"schedule": ["where is my child's timetable", "the class schedule is missing", "exam dates are not showing",
"the calendar shows the wrong week", "when is the parent meeting"],
"other": ["the website is slow", "please update my phone number", "how do I join the newsletter",
"the page looks broken on my phone", "who do I talk to about the bus"],
}
EXTRA = ["please help", "thank you", "on the portal", "since yesterday", "for my son", "for my daughter", "again", ""]
rng = random.Random(35)
tickets = [(f"{rng.choice(PHRASES[k])} {rng.choice(EXTRA)} {rng.choice(PHRASES[rng.choice(list(PHRASES))]) if rng.random() < 0.25 else ''}".strip(), k)
for k in PHRASES for _ in range(55)]
rng.shuffle(tickets)
train, test = tickets[:160], tickets[160:] # 60 tickets kept aside, never trained on
print(f"{len(train)} training tickets, {len(test)} held-out tickets")
print("Example:", test[0])
vectorizer = TfidfVectorizer(ngram_range=(1, 2))
X_train = vectorizer.fit_transform([t for t, _ in train])
model = LogisticRegression(max_iter=1000).fit(X_train, [k for _, k in train])
predicted = model.predict(vectorizer.transform([t for t, _ in test]))
print(classification_report([k for _, k in test], predicted, digits=2, zero_division=0))160 training tickets, 60 held-out tickets
Example: ('password reset email never came', 'login')
precision recall f1-score support
billing 0.94 0.88 0.91 17
login 0.93 1.00 0.97 14
other 0.93 0.93 0.93 15
schedule 1.00 1.00 1.00 14
accuracy 0.95 60
macro avg 0.95 0.95 0.95 60
weighted avg 0.95 0.95 0.95 60Explanation:
- Each ticket is built from a phrase of its kind, a few extra words, and sometimes (25% of the time) a phrase from another kind, to make them harder to sort.
TfidfVectorizerturns each ticket into word and word-pair weights, and logistic regression from "Logistic Regression and Classification" learns which ones point to which kind. The 60 test tickets are never used in training.classification_reportgives precision and recall for each kind, as in "Evaluating Models: Metrics". Overall accuracy is 0.95; billing has the lowest recall (0.88), so a few billing tickets were sent elsewhere.- This is a starting point, not a final result. The made-up tickets reuse a small set of phrases, so they are much easier than real ones. In your project, use real tickets (with personal data removed), and expect lower scores. Report them honestly.
What Makes an Intermediate Project Stand Out
| Quality | Example |
|---|---|
| Real data | 200 real, anonymized tickets instead of made-up ones |
| A baseline | Compare with a simple rule or keyword search; is the AI better? |
| Error analysis | Look at every mistake and group them by cause |
| A simple interface | A small web page or command-line tool someone else can use |
| A clear README | How to run it, what it scored, and its limits |
Common Mistakes
Testing on training data. Keep a held-out set from the start.
Reporting only accuracy. Per-category precision and recall show where it fails.
Made-up data presented as real. Say clearly what is synthetic.
No baseline. Without one, you can't tell whether AI was needed.
Interview Corner
How did you evaluate your classifier?
On a held-out test set it never trained on, with precision and recall per category and overall accuracy, compared with a simple baseline, plus a look at every mistake. Then I named the weakest category and what I'd do about it.
What is the difference between precision and recall?
Precision is how many of the items the model put in a category really belong there; recall is how many of the items that belong in the category the model found. A support system might care most about recall for urgent tickets.
Practice
Exercise: a baseline. Write a keyword rule (for example: "password", "log in" or "locked" means login; "charged", "fee" or "refund" means billing) and score it on the same 60 test tickets. How does it compare with the classifier's 0.95?
Check your understanding:
- Why are 60 tickets kept aside?
- Which category had the lowest recall, and what does that mean?
- Why would real tickets score lower?
Key Takeaways
Quick reference
| Need | Code or practice |
|---|---|
| Text features | TfidfVectorizer(ngram_range=(1, 2)) |
| Classifier | LogisticRegression(max_iter=1000) |
| Per-category report | classification_report(y_true, y_pred) |
| Honest testing | A held-out set, never used in training |
| Context | A simple baseline to compare against |
Was this tutorial helpful?