refactor: improve link scoring output format in release notes
This commit is contained in:
@@ -174,23 +174,20 @@ internal_links = result.links.get("internal", [])
|
|||||||
scored_links = [l for l in internal_links if l.get("total_score")]
|
scored_links = [l for l in internal_links if l.get("total_score")]
|
||||||
scored_links.sort(key=lambda x: x.get("total_score", 0), reverse=True)
|
scored_links.sort(key=lambda x: x.get("total_score", 0), reverse=True)
|
||||||
|
|
||||||
# Create a scoring table
|
# Print scoring results
|
||||||
table = Table(title="Link Scoring Results", box=box.ROUNDED)
|
print("Link Scoring Results:")
|
||||||
table.add_column("Link Text", style="cyan", width=40)
|
print("=" * 50)
|
||||||
table.add_column("Intrinsic Score", justify="center")
|
|
||||||
table.add_column("Contextual Score", justify="center")
|
|
||||||
table.add_column("Total Score", justify="center", style="bold green")
|
|
||||||
|
|
||||||
for link in scored_links[:5]:
|
for link in scored_links[:5]:
|
||||||
text = link.get('text', 'No text')[:40]
|
text = link.get('text', 'No text')[:40]
|
||||||
table.add_row(
|
intrinsic = link.get('intrinsic_score', 0)
|
||||||
text,
|
contextual = link.get('contextual_score', 0)
|
||||||
f"{link.get('intrinsic_score', 0):.1f}/10",
|
total = link.get('total_score', 0)
|
||||||
f"{link.get('contextual_score', 0):.2f}/1",
|
|
||||||
f"{link.get('total_score', 0):.3f}"
|
|
||||||
)
|
|
||||||
|
|
||||||
console.print(table)
|
print(f"Link: {text}")
|
||||||
|
print(f" Intrinsic Score: {intrinsic:.1f}/10")
|
||||||
|
print(f" Contextual Score: {contextual:.2f}/1")
|
||||||
|
print(f" Total Score: {total:.3f}")
|
||||||
|
print("-" * 30)
|
||||||
```
|
```
|
||||||
|
|
||||||
**Scoring Components:**
|
**Scoring Components:**
|
||||||
|
|||||||
Reference in New Issue
Block a user