Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why preprocess pubs in this way? #5

Open
CodeW1zard opened this issue Dec 21, 2018 · 0 comments
Open

why preprocess pubs in this way? #5

CodeW1zard opened this issue Dec 21, 2018 · 0 comments

Comments

@CodeW1zard
Copy link

CodeW1zard commented Dec 21, 2018

it seems that the each publication is converted to featues for multiple times in similiar ways? what is meaning of that? thanks!
`
def extract_author_features(item, order=None):

title_features, keywords_features, venue_features = extract_common_features(item)

author_features = []

for i, author in enumerate(item["authors"]):

    if order is not None and i != order:

        continue

    name_feature = []

    org_features = []

    org_name = string_utils.clean_name(author.get("org", ""))

    if len(org_name) > 2:

        org_features.extend(transform_feature(org_name, "org"))

    for j, coauthor in enumerate(item["authors"]):

        if i == j:

            continue

        coauthor_name = coauthor.get("name", "")

        coauthor_org = string_utils.clean_name(coauthor.get("org", ""))

        if len(coauthor_name) > 2:

            name_feature.extend(

                transform_feature([string_utils.clean_name(coauthor_name)], "name")

            )

        if len(coauthor_org) > 2:

            org_features.extend(

                transform_feature(string_utils.clean_sentence(coauthor_org.lower()), "org")

            )

    author_features.append(

        name_feature + org_features + title_features + keywords_features + venue_features

    )

author_features = list(chain.from_iterable(author_features))

return author_features

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant