Giter Site home page Giter Site logo

Comments (2)

jeromedockes avatar jeromedockes commented on July 23, 2024

Here is a script to generate the files in question:

import pathlib
import tempfile

import pandas as pd

from skrub.datasets._ken_embeddings import (
    fetch_ken_embeddings,
    fetch_ken_table_aliases,
    _correspondence_table_url,
    fetch_figshare,
)

out_dir = pathlib.Path(tempfile.mkdtemp(suffix="_ken_types"))
print(f"storing types in {out_dir}")
type(out_dir)
aliases = fetch_ken_table_aliases()

correspondence = pd.read_csv(_correspondence_table_url)
embedding_type_id = correspondence["type_figshare_id"].values[0]
emb_type = fetch_figshare(embedding_type_id).X
for table_name in aliases:
    print(table_name)
    entities = fetch_ken_embeddings(embedding_table_id=table_name)["Entity"].apply("<{}>".format)
    table_types = emb_type.merge(entities, on="Entity")
    table_types.to_parquet(out_dir / f"{table_name}.parquet", index=False)

print(f"embedding types are in {out_dir}")

from skrub.

jeromedockes avatar jeromedockes commented on July 23, 2024

there are still improvements we can do for the ken embeddings but the specific one suggested here has been applied in skrub-data/datasets#10 and circleci is now passing again so I'll close this issue

from skrub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.