hf_mirrors/query
Model Introduction
Files & versions
Analysis
You are visiting the mirror address of https://modelers.cn/Tianjin_Ascend/query. The repo is synchronized in real-time and is only for mirror acceleration access.


@misc {ashish_kumar_2024,
	author       = { {Ashish Kumar} },
	title        = { query_wellformedness_score (Revision 55a424c) },
	year         = 2024,
	doi          = { 10.57967/hf/1980 },
}

Modification Modified certain descriptions and modified the example code.

Intended Use Cases

Content Creation: Validate the well-formedness of written content.

Educational Platforms: Helps students check the grammaticality of their sentences.

Chatbots & Virtual Assistants: To validate user queries or generate well-formed responses.

contact: kua613@g.harvard.edu

Model name: Query Wellformedness Scoring

Description : Evaluate the well-formedness of sentences by checking grammatical correctness and completeness. Sensitive to case and penalizes sentences for incorrect grammar and case.

Features:

  • Wellformedness Score: Provides a score indicating grammatical correctness and completeness.
  • Case Sensitivity: Recognizes and penalizes incorrect casing in sentences.
  • Broad Applicability: Can be used on a wide range of sentences.

Example:

  1. Dogs are mammals.
  2. she loves to read books on history.
  3. When the rain in Spain.
  4. Eating apples are healthy for you.
  5. The Eiffel Tower is in Paris.

Among these sentences: Sentences 1 and 5 are well-formed and have correct grammar and case. Sentence 2 starts with a lowercase letter. Sentence 3 is a fragment and is not well-formed. Sentence 4 has a subject-verb agreement error.

example_usage:

import argparse
import torch
from openmind import pipeline, is_torch_npu_available
from openmind_hub import snapshot_download


def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--model_name_or_path",
        type=str,
        help="Path to model",
        default=None,
    )
    args = parser.parse_args()
    return args


def main():
    args = parse_args()
    model_path = args.model_name_or_path

    if is_torch_npu_available():
        device = "npu:0"
    else:
        device = "cpu"

    generator = pipeline('text-generation', model=model_path, device=device)

    output = generator("Hello, I'm a language model,", max_length=30, num_return_sequences=5)
    print(f">>>output={output}", flush=True)

Cite Ashishkr/query_wellformedness_score