Qwen 2.5 7B — Rural Water Monitoring Practices Classifier

Fine-tuned version of Qwen/Qwen2.5-7B-Instruct for classifying and extracting good and bad practices in rural water monitoring research papers.

Model Description

This model analyzes text chunks from academic papers and identifies whether they describe good or bad practices for rural water monitoring systems, classifying them across 14 predefined categories (7 good + 7 bad).

The model was fine-tuned with LoRA (r=32) on a dataset of 3516 chunks labeled by Qwen 2.5 72B Instruct AWQ.

Categories

Good practices: data_acquisition_technology, data_management, operation_maintenance, sustainability, community_participation, local_adaptation, scalability

Bad practices: inappropriate_technology, non_adaptable_infrastructure, cloud_dependency, high_costs, technical_complexity, centralization, rural_inaccessibility

Output Format

The model returns structured JSON:

{
  "contains_practice": true,
  "practices": [
    {
      "type": "good",
      "categories": ["data_acquisition_technology", "sustainability"],
      "span": "verbatim text from input",
      "explanation": "brief justification",
      "confidence": 0.92
    }
  ],
  "summary": "one-sentence summary"
}

Evaluation Results

Evaluated on a held-out set of 390 chunks:

Metric Value
JSON parse success 99.7%
Accuracy (contains_practice) 91.0%
Precision 90.2%
Recall 82.8%
F1 0.864
Type agreement (good/bad) 83.8%
Mean categories Jaccard 0.641

Training Details

Parameter Value
Base model Qwen/Qwen2.5-7B-Instruct
Method LoRA (r=32, alpha=64)
Trainable params 80.7M (1.05% of total)
Train samples 3516
Epochs 3
Batch size (effective) 16
Learning rate 2e-4 (cosine schedule)
Final train loss 1.0280
Final eval loss 1.0845
Hardware NVIDIA A100 SXM4 80GB
Training time ~1 hour

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained(
    "CaffeineAddict69/qwen7b-water-rural-practices",
    torch_dtype="bfloat16",
    device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("CaffeineAddict69/qwen7b-water-rural-practices")

system_prompt = '''You are an expert annotator for rural water monitoring research. Analyze text chunks from academic papers and identify practices (good or bad) related to rural water monitoring.

Categories of GOOD practices: data_acquisition_technology, data_management, operation_maintenance, sustainability, community_participation, local_adaptation, scalability.

Categories of BAD practices: inappropriate_technology, non_adaptable_infrastructure, cloud_dependency, high_costs, technical_complexity, centralization, rural_inaccessibility.

Return ONLY valid JSON with this schema:
{"contains_practice": true|false, "practices": [...], "summary": "..."}'''

text = "Your chunk text here..."
messages = [
    {"role": "system", "content": system_prompt},
    {"role": "user", "content": f"Analyze this chunk:\n\n---\n{text}\n---"},
]

inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device)
outputs = model.generate(inputs, max_new_tokens=1024, do_sample=False)
response = tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
print(response)

License & Citation

Apache 2.0. Inherits restrictions and rights from the base Qwen 2.5 model.

This model was developed for academic research on appropriate technologies for rural water monitoring.

Downloads last month
63
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for CaffeineAddict69/qwen7b-water-rural-practices

Base model

Qwen/Qwen2.5-7B
Adapter
(2600)
this model