Overview

I created a Course of Study code recommendation app, and this is an introduction to it. You can try it on the following Hugging Face Space. It utilizes the Course of Study LOD.

https://huggingface.co/spaces/nakamura196/jp-cos

Usage

Enter any text in the text form. “School Type” is an optional field.

Results are displayed on the right side of the screen.

Sample inputs are also provided, so please try them out. Information from NHK for School is used.

How It Works

Referencing the following article, the Course of Study text is vectorized, and similarly vectorized query text is used to return the most similar Course of Study items.

https://zenn.dev/yumefuku/articles/llm-langchain-rag

As described in the above article, “FAISS” is used as the vector search library and “multilingual-e5-large” is used as the embedding model.

https://huggingface.co/intfloat/multilingual-e5-large

The source code for the inference part can be found at the following link.

https://huggingface.co/spaces/nakamura196/jp-cos/blob/main/app.py

Design Highlights

Filtering by “School Type” and Other Criteria

When “School Type” is specified, filtering is applied during the similarity search using langchain’s FAISS.similarity_search_with_score.

Specifically, the following filter is used.

miteefrxtycag:edrmdppraaeotretdtcitaeasEnu:d_xtr=aac(ntnef{adp"[}[_tE]"sircoronorrea"ssd]u=er=:iingngrdaesdxee.asricmhi:la{rei}t"y)_search_with_score(input_text,filter=metadata)

Future Plans

Filtering by “Subject”

In addition to filtering by “School Type”, filtering by “Subject (Science, Social Studies, Mathematics, etc.)” is planned.

Evaluation of Recommendation Accuracy

We plan to evaluate recommendation accuracy using NHK for School content that already has Course of Study codes assigned.

Adding More “School Types”

Currently, only the following 7 school types are used. Other Courses of Study will be added in the future.

  • UpperSecondary/2018
  • UpperSecondaryDeptSNES/2019
  • Elementary/2017
  • ElementaryAndLowerSecondaryDeptSNES/2017
  • LowerSecondary/2017
  • Kindergarten/2017
  • KindergartenDeptSNES/2017

Summary

I am grateful to the developers of the Course of Study LOD.