Skip to main content

The Usage of GPLWordNet

Introduction

GPL WordNet (Generating Polarity Lexicions with WordNet) is a lexicon-generating tool that uses WordNet as a database to find two sets of lexicons.

It provides two basic function,

  • Full expansion: This function is used to find target words' antonyms, synsets, adjectives, derivational words, and hyponyms.
  • Antonyms expansion - This function is used for finding target words' antonyms.

This tool is an extended Python version of Nicolas et al.'s dictionary-generating approach. As their team only provides the R version, it is quite hard to use. Therefore, I provide this Python version, and you can absolutely improve and self-define this package's function by git my code from my GitHub.

Function

  1. example.full_expand()
  2. example.antonyms_expand()
Function Name Features
full_expand() find target words' antonyms, synsets, adjectives, derivational words, and hyponyms
antonyms_expand() find target words' antonyms

Agruments

Input Parameters

1. full_expand() function

Parameter Name Required Type Description
datax Yes list A list where each dictionary contains 'term', 'PoS', and 'sense'. 'term' (str): The word to expand.'PoS' (str): Part of Speech ('NOUN', 'VERB', 'ADJECTIVE').The specific sense index to use for the term(False,single words; True, synsets).
antonym No bool Whether to include antonyms in the expansion. Defaults to True.
syns No bool Whether to return synsets. Defaults to False.

Notes: Only key 'term' is compulsory.

2. antonyms_expand() function

Parameter Name Required Type Description
datax Yes list A list where each dictionary contains 'term', 'PoS', and 'sense'. 'term' (str): The word to expand.'PoS' (str): Part of Speech ('NOUN', 'VERB', 'ADJECTIVE').The specific sense index to use for the term(False,single words; True, synsets).
syns No bool Whether to return synsets. Defaults to False.

Notes: Only key 'term' is compulsory.

Output Parameters

1. full_expand() function

Parameter Name Type Description
You called function list A list of unique words or synsets, expanded from the input terms based on the specified relationships.

2. antonyms_expand() function

Parameter Name Type Description
You called function list A list of unique words or synsets, expanded from the input terms based on the specified relationships.

Example

1. full_expand() function

Basic function

data = [{'term': 'good'}]
print(example.full_expand(data))
data = [{'term': 'good', 'PoS': 'ADJECTIVE'}]
print(example.full_expand(data))

Extra Parameters

data = [{'term': 'good', 'PoS': 'ADJECTIVE'}]
print(example.full_expand(data,syns=True,antonym=False))

2.antonyms_expand() function

Basic function

data = [{'term': 'good', 'PoS': 'ADJECTIVE'}]
print(example.antonyms_expand(data))

Extra Parameters

data = [{'term': 'good', 'PoS': 'ADJECTIVE'}]
print(example.antonyms_expand(data,syns=True))

Supplemantal Materials

  1. This work is an replication work of Nicolas' SADCAT codes, which only have R version. For more details about Nicolas Works, please refer to following link,

  2. The approach I mainly learned from Maks et al.'s(2014) Paper.

Call for Contributions

The GPLWordNet project welcomes your expertise and enthusiasm!

Small improvments of fixes are always appreciated, please submit your feature according GitHUb.

Our preferred channels of communication are all public, but if you’d like to speak to us in private first, contact my public email at xuanlongqin.cu@gmail.com .

Acknowledge

I would like to sincerely thank my dear Ling Yan, who spent three hours accompanying me and watching TV series alone during this period, supporting me to complete this project.

Release files for GPLWordNet 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for GPLWordNet 1.0.3
File Size Uploaded
gplwordnet-1.0.3.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for GPLWordNet 1.0.3
File Interpreter ABI Platform
GPLWordNet-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size:14.6 kB

Release files / gplwordnet-1.0.3.tar.gz

Download URL gplwordnet-1.0.3.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cae41a154b92326026d6a53f178de7bc330519cc87ae0d255927917c103fb3ba
BLAKE2b-256 checksum
How to use checksums
e140a28abf321e7ac7ce7179ec267f9c0248f9ffa9ad6f9499748af5d5536f6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.17

Release files / GPLWordNet-1.0.3-py3-none-any.whl

Download URL GPLWordNet-1.0.3-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76de3294dddb0f7d2b873dea4ef4eab83b2a485c886ed5ae004892bda7811f22
BLAKE2b-256 checksum
How to use checksums
ffe46aeb4d1b16b3895a4866b376186c861216d4ede4b59addb516cb4b556290
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.17

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page