as

Projects / AI-Assisted Knowledge Extraction

AI-Assisted Knowledge Extraction

Pulling structured fields out of photovoltaic papers. I did this as an intern at the Florida Solar Energy Center. The report is on OSF.

Why

The numbers in a PV paper are stuck in prose and tables. Asking a model to “summarize the paper” does not give you a column you can join. The job was a schema: the same fields, every paper, filled or left empty on purpose.

Diagrams

A solid outline is the path in the repo. A dashed outline is the alternative that shape is refusing.

LangChain runs the extraction. Pydantic holds the schema, so a value of the wrong type does not land in the table. Ollama serves Gemma 3 1B. A LoRA fine-tune of Gemma 3 4B is the other model, through Hugging Face.

flowchart TD
  papers["Photovoltaic papers"]
  chain["LangChain"]
  schema["Pydantic schema"]
  small["Ollama, Gemma 3 1B"]
  lora["LoRA Gemma 3 4B"]
  papers --> chain --> schema
  schema --> small
  schema --> lora
  class papers,chain,schema,small,lora chosen
          

The job was the same fields on every paper, filled or left empty on purpose. A summary does not give a column you can join. The 1B model is the local one. The fine-tuned 4B is the other tool. They are not the same run.

flowchart TD
  q{What comes out of a paper}
  q -->|"same fields, empty on purpose"| schema["Schema-constrained extraction"]
  q -->|"a paragraph and no columns"| summary["Summarize the paper"]
  class schema chosen
  class summary rejected
          

Why this shape

LangChain runs the extraction. Pydantic holds the schema, so a field that does not match the type does not sneak into the table. Two models are in the writeup on this site. Ollama serves Gemma 3 1B. A LoRA fine-tune of Gemma 3 4B, through Hugging Face, is the other. The corpus is 100+ photovoltaic papers. Against baseline prompting, the schema-constrained run raised structured accuracy 63% and cut hallucinations 42%. Those figures are the ones on my work page for this internship.

Where it breaks

A schema only catches fields it names. A number the schema forgot is dropped even if the paper states it. The 1B model and the fine-tuned 4B are different tools. The smaller one is cheaper to run locally and worse at the dense pages. The OSF deposit is the report. This page does not restate tables that are not on the site.