Skip to content

Commit

Permalink
add attachable property
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengshuLi committed Mar 14, 2024
1 parent 5a203e0 commit ec8de28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bddl/data_generation/get_syn_prop_annots_canonical.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import pathlib
from nltk.corpus import wordnet as wn
import bddl.data_generation.prop_config as pcfg
from bddl.bddl_verification import VALID_ATTACHMENTS


CANONICAL_FN = pathlib.Path(__file__).parents[1] / "generated_data" / "syn_prop_annots_canonical.json"
Expand All @@ -21,7 +22,6 @@
DESIRED_PROPS = set(pcfg.CROWD_PROP_NAMES + pcfg.GPT_PROP_NAMES + pcfg.INTERNAL_PROP_NAMES)

PROP_TO_DESC = { #added by hand from B1K Object States Google Doc found here https://docs.google.com/document/d/10g5A-ODF4POFN0SxIhiQIuDh5L1X_8KXriwKfaKWUFc/edit?usp=sharing as of May 12, 2022

"breakable": "broken",
"burnable": "burnt",
"cleaningTool": None,
Expand Down Expand Up @@ -68,6 +68,7 @@
"rustable": "rusty",
"wrinkleable": "wrinkly",
"disinfectable": "disinfected",
"attachable": "attached",
"mixable": None,
"blendable": None,
"rope": None,
Expand Down Expand Up @@ -115,6 +116,7 @@ def get_annots_canonical(syn_prop_dict):
############ GETTING PROPERTIES #############

def add_programmatic_properties(synset_content): # runs programmatic addition over existing canonical input
valid_attachments_dict = dict(VALID_ATTACHMENTS)
for synset in synset_content:
if "liquid" in synset_content[synset]:
synset_content[synset]["boilable"] = {}
Expand All @@ -132,6 +134,8 @@ def add_programmatic_properties(synset_content): # runs programmatic addition ov
if ("nonSubstance" in synset_content[synset]) and ("cookable" in synset_content[synset] or "fillable" in synset_content[synset]):
# cookables and fillables are both freezable
synset_content[synset]["freezable"] = {}
if synset in valid_attachments_dict.keys() or synset in valid_attachments_dict.values():
synset_content[synset]["attachable"] = {}
if "nonSubstance" in synset_content[synset]: # non-substances are both wetable and mixable
synset_content[synset].update({
"wetable": {},
Expand Down

0 comments on commit ec8de28

Please sign in to comment.