Skip to main content

Language analyser for trivia questions — parse, classify, and score question difficulty

Project description

langgraph-tavily

Language analyser for trivia questions. Parse, classify, and score question difficulty using linguistic features.

Installation

pip install langgraph-tavily

Usage

from langgraph_tavily import TriviaAnalyser, TriviaGenerator

# Analyse a question
analyser = TriviaAnalyser()
result = analyser.analyse("What ancient wonder was located in Alexandria?")
print(result.difficulty)        # hard
print(result.question_type)     # what
print(result.category)          # history
print(result.difficulty_score)  # 0.52
print(result.keywords)          # ['ancient', 'wonder', 'located', 'alexandria']

# Compare two questions
cmp = analyser.compare(
    "What color is the sky?",
    "In what year was the Treaty of Westphalia signed?"
)
print(cmp["harder"])  # q2

# Generate a quiz
gen = TriviaGenerator()
quiz = gen.quiz(count=10, mix=True)
for q in quiz:
    print(q.text)

CLI

langgraph-tavily analyse "Who composed The Rite of Spring?"
langgraph-tavily analyse "What is 2+2?" --json
langgraph-tavily compare "What is the capital of France?" "Which element has atomic number 79?"
langgraph-tavily quiz --count 5 --difficulty medium --show-answers
langgraph-tavily batch questions.txt --json

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langgraph_tavily-0.1.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langgraph_tavily-0.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file langgraph_tavily-0.1.0.tar.gz.

File metadata

  • Download URL: langgraph_tavily-0.1.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for langgraph_tavily-0.1.0.tar.gz
Algorithm Hash digest
SHA256 de1dc24056d15748056c569faea018f523c5c41d1bfdc92ec232964adeccb166
MD5 60d0794ef95da826abf2fe4e17cff9f2
BLAKE2b-256 6b4bab4cdc5548e1e4a24fbc3b3c89074a4e5470c7cc4d44f7598fcfb49001d0

See more details on using hashes here.

File details

Details for the file langgraph_tavily-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langgraph_tavily-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76834ebc39d5c46f42d9b41706165907e8127a15330b9d7a32f1975b85676e2f
MD5 edcbe0541b4e68abbbd3f865e2cb55fb
BLAKE2b-256 faaa0b9e0fdc08e99d10c20e1d3a612f459e8cfa370727eb1356f33d58661d5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page