History of word_assoc_usf
The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.
[entries] Add the date when each entry was added, and remove icon_hash beff7c9
The dates are those of the commits that first added the entries' files (2020-08-11 for the entries of the initial commit); renamed entries keep the date of their first name. Changed: none
diff --git a/entries/word_assoc_usf/__init__.py b/entries/word_assoc_usf/__init__.py
index 42d2426..8d8349b 100644
--- a/entries/word_assoc_usf/__init__.py
+++ b/entries/word_assoc_usf/__init__.py
@@ -51,7 +51,7 @@ A version of this network without weights or attributes (and without the self-lo
tags = ['Informational', 'Language', 'Weighted', 'Metadata']
url = 'http://w3.usf.edu/FreeAssociation/'
citation = [('D. L. Nelson, C. L. McEvoy, and T. A. Schreiber, "The University of South Florida free association, rhyme, and word fragment norms." Behavior Research Methods, Instruments, & Computers 36(3), 402-407 (2004).', 'https://doi.org/10.3758/BF03195588')]
-icon_hash = '56a85c8e26855e083a2f793e'
+date_added = '2026-10-25'
upstream_license = None
upstream_prefix = 'http://w3.usf.edu/FreeAssociation/AppendixA'
files = [(tuple(f'Cue_Target_Pairs.{x}' for x in
[entries] Remove unneeded code from the entries 2c69f19
Unneeded "global files" statements, unused imports and variables, f-strings without placeholders, duplicate keys in foodweb_little_rock (keeping the order and the values used), and the second definition of get_lines() in twitter_higgs. Nothing changes in the networks or descriptions. Changed: none
diff --git a/entries/word_assoc_usf/__init__.py b/entries/word_assoc_usf/__init__.py
index 930894c..42d2426 100644
--- a/entries/word_assoc_usf/__init__.py
+++ b/entries/word_assoc_usf/__init__.py
@@ -71,7 +71,6 @@ def _num(x, t=float):
@coerce_props()
@annotate()
def parse(alts=None):
- global files
name = __name__.split(".")[-1]
for fnames, alt, fmt in files:
if alts is not None and alt not in alts:
[entries] New entry: word_assoc_usf 73d6e43
diff --git a/entries/word_assoc_usf/__init__.py b/entries/word_assoc_usf/__init__.py
new file mode 100644
index 0000000..930894c
--- /dev/null
+++ b/entries/word_assoc_usf/__init__.py
@@ -0,0 +1,146 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020-2026 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+from .. import *
+
+title = "USF free association norms (1998)"
+description = """A directed network of free word associations, from the University of South Florida (USF) free association norms, collected by D. L. Nelson, C. L. McEvoy and T. A. Schreiber from 1973 onwards with more than 6,000 participants in the United States, and made available in 1998. Participants were given a printed cue word and asked to write the first word that came to mind that was meaningfully related or strongly associated to it; each cue was normed by a group of about 150 participants (each participant saw at most about 100 cues). Nodes are words (10,617 words, of which 5,018 were normed as cues), and a directed edge from a cue to a target indicates that the target was given as a response to the cue by at least two participants (responses given by a single participant are not included in the norms). There are 72,176 cue-target pairs, including 4 in which a cue was given as its own response (self-loops).
+
+Edge properties (as in the "Appendix A" files of the norms):
+
+- `group_size`: number of participants in the group that normed the cue (#G).
+- `n_responses`: number of participants that produced the target in response to the cue (#P).
+- `fsg`: forward (cue-to-target) strength, i.e. `n_responses / group_size`.
+- `bsg`: backward (target-to-cue) strength, the forward strength of the reverse pair (zero if the target did not produce the cue; NaN if the target was not normed).
+- `msg`: mediated (two-step) strength, the sum over mediating words m of the products of the cue-to-m and m-to-target strengths (NaN if the target was not normed).
+- `osg`: overlapping associate strength, the sum over the associates shared by the cue and the target of the products of their strengths to them (NaN if the target was not normed).
+- `n_mediators`, `n_mediators_unnormed`: number of mediating words, and of potential mediators that were not normed (so that `msg` may be underestimated).
+- `n_overlaps`, `n_overlaps_unnormed`: number of associates shared by cue and target, and of shared associates that were not normed.
+
+Vertex properties (word attributes, available only for the normed words, otherwise they are -1, NaN or empty):
+
+- `word`: the word.
+- `normed`: whether the word was normed as a cue.
+- `set_size`: number of different responses given by two or more participants to the word.
+- `frequency`: printed frequency of the word, from the Kučera and Francis (1967) norms (a few very frequent words, such as "A", have the value 9999).
+- `concreteness`: concreteness rating (1 to 7), mostly from the Paivio, Yuille and Madigan (1968) or Toglia and Battig (1978) norms.
+- `homograph`: whether the word is (likely) a homograph, given as the initial of the source of homograph norms (empty if not a homograph).
+- `part_of_speech`: part of speech of the first dictionary entry of the word (N: noun, V: verb, AJ: adjective, AD: adverb, P: pronoun, PP: preposition, I: interjection, C: conjunction).
+- `mean_connectivity`: mean number of connections among the associates of the word.
+- `resonance_probability`: fraction of the associates of the word that produce the word as an associate.
+- `resonance_strength`: sum over associates of the products of the word-to-associate and associate-to-word strengths.
+- `use_code`: 1 if all important associates of the word were normed (recommended for experiments), 0 otherwise.
+
+A version of this network without weights or attributes (and without the self-loops) is also distributed by the Laboratory for Web Algorithmics as `wordassociation-2011`."""
+tags = ['Informational', 'Language', 'Weighted', 'Metadata']
+url = 'http://w3.usf.edu/FreeAssociation/'
+citation = [('D. L. Nelson, C. L. McEvoy, and T. A. Schreiber, "The University of South Florida free association, rhyme, and word fragment norms." Behavior Research Methods, Instruments, & Computers 36(3), 402-407 (2004).', 'https://doi.org/10.3758/BF03195588')]
+icon_hash = '56a85c8e26855e083a2f793e'
+upstream_license = None
+upstream_prefix = 'http://w3.usf.edu/FreeAssociation/AppendixA'
+files = [(tuple(f'Cue_Target_Pairs.{x}' for x in
+ ["A-B", "C", "D-F", "G-K", "L-O", "P-R", "S", "T-Z"]), None, None)]
+
+def fetch_upstream(force=False):
+ return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+ force)
+
+def _num(x, t=float):
+ try:
+ return t(float(x))
+ except ValueError:
+ return t(-1) if t is int else numpy.nan
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+ global files
+ name = __name__.split(".")[-1]
+ for fnames, alt, fmt in files:
+ if alts is not None and alt not in alts:
+ continue
+ rows = []
+ with ExitStack() as stack:
+ fs = [stack.enter_context(open_upstream_file(name, fn, "rb")) for fn in fnames]
+ for f in fs:
+ for line in f.read().split(b"\n"):
+ # HTML <PRE> blocks with comma-separated fields; missing
+ # values are marked with a non-ASCII character
+ line = line.decode("latin-1").rstrip("\r\n")
+ if "," not in line:
+ continue
+ row = [x.strip() for x in line.split(",")]
+ if row[:3] == ["CUE", "TARGET", "NORMED?"]:
+ continue
+ if len(row) != 31:
+ raise ValueError(f"invalid line: {line}")
+ rows.append(row)
+
+ words = {}
+ for r in rows:
+ for w in r[:2]:
+ if w not in words:
+ words[w] = len(words)
+ g = Graph(directed=True)
+ g.add_vertex(len(words))
+ g.add_edge_list([(words[r[0]], words[r[1]]) for r in rows])
+ g.vp.word = g.new_vp("string", vals=list(words.keys()))
+
+ eprops = [("group_size", "int", 3, int), ("n_responses", "int", 4, int),
+ ("fsg", "double", 5, float), ("bsg", "double", 6, float),
+ ("msg", "double", 7, float), ("osg", "double", 8, float),
+ ("n_mediators", "int", 9, int),
+ ("n_mediators_unnormed", "int", 10, int),
+ ("n_overlaps", "int", 11, int),
+ ("n_overlaps_unnormed", "int", 12, int)]
+ for pname, ptype, i, t in eprops:
+ g.ep[pname] = g.new_ep(ptype, vals=[_num(r[i], t) for r in rows])
+
+ # Word attributes, from the cue fields (13-21) of the rows in which
+ # the word is the cue, otherwise from the target fields (22-30) of
+ # the rows in which it is a normed target. (The two disagree for a
+ # few words, e.g. in the part of speech; the cue fields are used.)
+ attrs = {}
+ for r in rows:
+ if r[2] == "YES" and r[1] not in attrs:
+ attrs[r[1]] = r[22:31]
+ for r in rows:
+ attrs[r[0]] = r[13:22]
+ vprops = [("set_size", "int", 0, int), ("frequency", "int", 1, int),
+ ("concreteness", "double", 2, float), ("homograph", "string", 3, str),
+ ("part_of_speech", "string", 4, str),
+ ("mean_connectivity", "double", 5, float),
+ ("resonance_probability", "double", 6, float),
+ ("resonance_strength", "double", 7, float),
+ ("use_code", "int", 8, int)]
+ g.vp.normed = g.new_vp("bool")
+ for pname, ptype, i, t in vprops:
+ vals = []
+ for w in words:
+ a = attrs.get(w)
+ if a is None:
+ vals.append("" if t is str else _num("", t))
+ elif t is str:
+ vals.append(a[i] if a[i].isascii() else "")
+ else:
+ vals.append(_num(a[i], t))
+ g.vp[pname] = g.new_vp(ptype, vals=vals)
+ g.vp.normed.a = [w in attrs for w in words]
+ yield alt, g