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

Completed the functions related to Reference Entity Linking #42

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Alex592800
Copy link

Two class:

ReferenceEntityLinkingLocal: The pipeline for reference entity linking (Local Version, No Internet Connection Required).

ReferenceEntityLinkingOnline: The pipeline for reference entity linking (Online Version, Requires Network for Retrieving Corresponding Reference Articles).

1.For ReferenceEntityLinkingLocal:
Example:

            >>> from SciAssist import ReferenceEntityLinkingLocal
            >>> pipeline = ReferenceEntityLinkingLocal()
            >>> pipeline.predict(
            ...     './sample_papers'
            ... )

            [
                {
                    "reference_key": "0_6|bert: pre-training of deep bidirectional transformers for language understanding",
                    "cited_references": [
                        ["0_6", "bert: pre-training of deep bidirectional transformers for language understanding"],
                        ["2_11", "bert: pretraining of deep bidirectional transformers for lan-guage understanding"]
                        ]
                    "cited_number": cited_number
                },
                // ... Another JSON objects
            ]

2.For ReferenceEntityLinkingOnline, there are 2 functions: predict(file_dir) and batch_title_to_references(title_list)
2.1 For predict(file_dir):
Example:
>>> from SciAssist import ReferenceEntityLinkingOnline
>>> pipeline = ReferenceEntityLinkingOnline()
>>> pipeline.predict(
... './sample_papers'
... )

        [
            {
                "reference_id": "3f144a0d7ad2d92589f61cf466acc921c6d6a123",
                "detail":{
                    "paperId": "3f144a0d7ad2d92589f61cf466acc921c6d6a123",
                    "title": "Automatic Generation of Related Work Sections in Scientific Papers: An Optimization Approach",
                    "isOpenAccess": true,
                    "openAccessPdf": {"url": "https://aclanthology.org/D14-1170.pdf", "status": null},
                    "citationStyles": {"bibtex": "@Misc{None,\n author = {Yue Hu and Xiaojun Wan},\n title = {Automatic Generation of Related Work Sections in Scientific Papers: An Optimization Approach}\n}\n"},
                    "authors": [{"authorId": "2108954687", "name": "Yue Hu"}, {"authorId": "145078589", "name": "Xiaojun Wan"}],
                    "cited_number": 3
                    }
            },
            // ... Another JSON objects
        ]


    2.2 For batch_title_to_references(title_list)
    Example:
        >>> from SciAssist import ReferenceEntityLinkingOnline
        >>> pipeline = ReferenceEntityLinkingOnline()
        >>> pipeline.batch_title_to_references(
        ...     [
        ...            'Automatic generation of related work sections in scientific papers: an Optimization Approach',
        ...            'Automatic Generation of Citation Texts in Scholarly Papers: A Pilot Study',
        ...             #... Another Title Strings
        ...       ]
        ... )

        [
            {
                "reference_id": "3f144a0d7ad2d92589f61cf466acc921c6d6a123",
                "detail":{
                    "paperId": "3f144a0d7ad2d92589f61cf466acc921c6d6a123",
                    "title": "Automatic Generation of Related Work Sections in Scientific Papers: An Optimization Approach",
                    "isOpenAccess": true,
                    "openAccessPdf": {"url": "https://aclanthology.org/D14-1170.pdf", "status": null},
                    "citationStyles": {"bibtex": "@Misc{None,\n author = {Yue Hu and Xiaojun Wan},\n title = {Automatic Generation of Related Work Sections in Scientific Papers: An Optimization Approach}\n}\n"},
                    "authors": [{"authorId": "2108954687", "name": "Yue Hu"}, {"authorId": "145078589", "name": "Xiaojun Wan"}],
                    "cited_number": 3
                    }
            },
            // ... Another JSON objects
        ]

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

Successfully merging this pull request may close these issues.

1 participant