How wannaflyhigh/latia112-1 works
Project type and purpose
• This repository is a student’s LATIA112-1 course workspace. The “final” directory contains the actual deliverable: a Node.js–based LINE chatbot that uses OCR and the OpenAI API to process messages and image uploads, looks up or generates responses (sometimes via CSV data), and returns results to users on LINE.
File structure (focus on the “final” folder)
• Top-level of “final”
• app.js – Main Express/Koa (or similar) server entrypoint, sets up HTTP/webhook.
• linebot.js – Module that handles incoming LINE events (text, image) and routes to services.
• ocr.js – Wrappers around Tesseract OCR using .traineddata files (chi_tra.traineddata, eng.traineddata).
• openai.js – Wrapper for OpenAI API requests (GPT-based prompts).
• readCsv.js – Utility to parse CSV files and produce JSON or lookup results (e.g., parsed.json).
• parsed.json – Cached or pre-computed data extracted from CSVs.
• data_collect/ – Python scripts and notebooks (sele.py, test.ipynb) for scraping or assembling CSV data (源数据处理).
• package.json – Defines Node.js dependencies (line-bot-sdk, tesseract.js, openai node client, etc.) and scripts.
• linebot.js – Webhook handler specific to LINE Messaging API.
• ocr-traineddata files – Language packs for OCR.
README for additional insights
• The top-level README simply catalogs homework and the final project.
• The “final/README.md” (if present) likely describes usage, environment variables (LINE channel token, OpenAI key), and start scripts.
Elements
• Clear labels: “LINE Messaging Platform,” “Node.js Server,” “OCR Module,” “OpenAI Module,” “CSV Data Store,” “Data Collection Scripts.”
– Core server modules (messaging, OCR, NLP, data access) in another