Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/691c1dba-9228-800f-8463-13b3a9006306
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== simple example uses a local small summarizer (you can call your controller API) === def call_local_summarizer(text, max_tokens=400): # Placeholder: replace with HTTP call to your controller or local llama.cpp runner # For now, return a naive truncation summary return text[:400] + ("β¦" if len(text)>400 else "") def main(): ap = argparse.ArgumentParser() ap.add_argument("indir") args = ap.parse_args() p = Path(args.indir) outdir = p / "summaries" outdir.mkdir(exist_ok=True) for f in p.glob("*.json"): obj = json.loads(f.read_text(encoding='utf-8')) # canonical summary content candidates: hplm, hplm.summary, body fields text = "" if 'hplm' in obj: text = json.dumps(obj['hplm'], ensure_ascii=False) else: text = json.dumps(obj, ensure_ascii=False) summary = call_local_summarizer(text, max_tokens=400) outfile = outdir / (f.stem + "_summary.json") outobj = {"src": str(f), "summary": summary} outfile.write_text(json.dumps(outobj, ensure_ascii=False, indent=2), encoding='utf-8') print("Wrote", outfile) if __name__=='__main__': main() * Replace call_local_summarizer with your webui POST to a model you want to use for summarization (controller API). Keep summaries short (β€ 600 tokens). ==== 3) Compare & score (semantic similarity + evaluator) ==== Weβll produce a simple embedding-based similarity using sentence-transformers if you have it, or fallback to token-overlap. Save compare_score.py: python #!/usr/bin/env python3
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)