SPB Git forge

spb/ai-atlas

Public
41commits 1branches 0releases
4.6 MBsize
maindefault branch
12 days agolast push
HTML 77.2% TypeScript 10.5% Python 9.6% JavaScript 2.5%
1.8 KB · 29 lines python
Raw Blame History
1from aiatlas.connectors.labs.apple_ml import FEED, AppleMLConnector2from aiatlas.sdk.facts import Target3from tests.conftest import claims_of, extract_from_fixture, fixture_path45DISCOSIGN = "https://machinelearning.apple.com/research/discosign-gloss-translation"678async def test_feed_papers():9    facts = await extract_from_fixture(AppleMLConnector(), Target(url=FEED, doc_type="feed", key="feed"), fixture_path("apple_ml", "rss.xml"), content_type="text/xml")10    papers = [e for e in facts.entities if e.entity_type == "paper"]11    assert len(papers) == 1012    disco = next(p for p in papers if p.name.startswith("DiscoSign"))13    assert disco.identifiers == {"url": DISCOSIGN}14    claims = claims_of(facts, disco.name)15    assert claims["published_at"] == "2026-09-11" and claims["abstract"].startswith("Sign language processing systems")16    assert sum(r.predicate == "published_by" for r in facts.relations) == 1017    assert len(facts.events) == 10 and len([t for t in facts.targets if t.doc_type == "paper_page"]) == 10181920async def test_paper_page():21    target = Target(url=DISCOSIGN, doc_type="paper_page", key="paper:discosign-gloss-translation")22    facts = await extract_from_fixture(AppleMLConnector(), target, fixture_path("apple_ml", "paper-discosign.html"))23    paper = next(e for e in facts.entities if e.entity_type == "paper")24    assert paper.identifiers["arxiv"] == "2609.02796"25    claims = claims_of(facts, paper.name)26    assert claims["arxiv_id"] == "2609.02796" and claims["pdf_url"] == "https://arxiv.org/pdf/2609.02796"27    assert claims["authors"][0] == "Vasileios Baltatzis" and claims["authors"][-1] == "Colin Lea" and len(claims["authors"]) == 728    assert "published_at" not in claims                                  # day-precision date comes from the feed only29