1 / 21

LING 581: Advanced Computational Linguistics

LING 581: Advanced Computational Linguistics. Lecture Notes March 29th. Step 1: Install WordNet 3.0. URL: http://wordnet.princeton.edu/wordnet/download/ File: WordNet-3.0.tar.gz expands to. Step 1: Install WordNet 3.0. Process configure make s udo make install .

teddy
Download Presentation

LING 581: Advanced Computational Linguistics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LING 581: Advanced Computational Linguistics Lecture Notes March 29th

  2. Step 1: Install WordNet 3.0 • URL: http://wordnet.princeton.edu/wordnet/download/ • File: WordNet-3.0.tar.gz expands to

  3. Step 1: Install WordNet 3.0 • Process • configure • make • sudo make install (platform dependencies) (compile programs) (put compiled programs into their proper places) but things may not run smooth …

  4. Step 1: Install WordNet 3.0 Configure douglass-dhcp45:research sandiway$ mv ~/Downloads/WordNet-3.0 . douglass-dhcp45:research sandiway$ cd WordNet-3.0/ douglass-dhcp45:WordNet-3.0 sandiway$ ./configure --help `configure' configures WordNet 3.0 to adapt to many kinds of systems. Usage: ./configure [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print `checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for `--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or `..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [/usr/local/WordNet-3.0] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] B y default, `make install' will install all the files in `/usr/local/WordNet-3.0/bin', `/usr/local/WordNet-3.0/lib' etc. You can specify an installation prefix other than `/usr/local/WordNet-3.0' using `--prefix', for instance `--prefix=$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-tcl directory containing tcl configuration (tclConfig.sh) --with-tk directory containing tk configuration (tkConfig.sh) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to wordnet@princeton.edu.

  5. Step 1: Install WordNet 3.0 ./configure --with-tcl=/Library/Frameworks/Tcl.framework --with-tk=/Library/Frameworks/Tk.framework checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ranlib... ranlib checking for a BSD-compatible install... /usr/bin/install -c checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking locale.h usability... yes checking locale.h presence... yes checking for locale.h... yes checking malloc.h usability... no checking malloc.h presence... no checking for malloc.h... no checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for strchr... yes checking for strdup... yes checking for strrchr... yes checking for strstr... yes checking for strtol... yes checking for nl_langinfo and CODESET... yes checking whether build environment is sane... yes checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking for Tcl configuration... found /Library/Frameworks/Tcl.framework/tclConfig.sh checking for Tk configuration... found /Library/Frameworks/Tk.framework/tkConfig.sh checking for existence of /Library/Frameworks/Tcl.framework/tclConfig.sh... loading checking for existence of /Library/Frameworks/Tk.framework/tkConfig.sh... loading configure: creating ./config.status config.status: creating Makefile config.status: creating dict/Makefile config.status: creating doc/Makefile config.status: creating doc/html/Makefile config.status: creating doc/man/Makefile config.status: creating doc/pdf/Makefile config.status: creating doc/ps/Makefile config.status: creating include/Makefile config.status: creating include/tk/Makefile config.status: creating src/Makefile config.status: creating lib/Makefile config.status: creating lib/wnres/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing default commands WordNet is now configured Installation directory: /usr/local/WordNet-3.0 options specific to MacOS X requires Xcode to be installed for the Mac Default prefix is /usr/local

  6. Step 1: Install WordNet 3.0 The fix • Make douglass-dhcp45:WordNet-3.0 sandiway$ make make all-recursive … Making all in src if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include -I/Library/Frameworks/Tcl.framework/Versions/8.4/Headers -I/usr/local/include -I.. -I../include -I/Library/Frameworks/Tcl.framework/Versions/8.4/Headers -I/usr/local/include -g -O2 -MT wn-wn.o -MD -MP -MF ".deps/wn-wn.Tpo" -c -own-wn.o `test -f 'wn.c' || echo './'`wn.c; \ then mv -f ".deps/wn-wn.Tpo" ".deps/wn-wn.Po"; else rm -f ".deps/wn-wn.Tpo"; exit 1; fi wn.c: In function ‘printsearches’: wn.c:286: warning: format not a string literal and no format arguments wn.c: In function ‘error_message’: wn.c:347: warning: format not a string literal and no format arguments gcc -g -O2 -ownwn-wn.o -L../lib -lWN if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include -I/Library/Frameworks/Tcl.framework/Versions/8.4/Headers -I/usr/local/include -I.. -I../include -I/Library/Frameworks/Tcl.framework/Versions/8.4/Headers -I/usr/local/include -g -O2 -MT wishwn-tkAppInit.o -MD -MP -MF ".deps/wishwn-tkAppInit.Tpo" -c -owishwn-tkAppInit.o `test -f 'tkAppInit.c' || echo './'`tkAppInit.c; \ then mv -f ".deps/wishwn-tkAppInit.Tpo" ".deps/wishwn-tkAppInit.Po"; else rm -f ".deps/wishwn-tkAppInit.Tpo"; exit 1; fi In file included from tkAppInit.c:16: /usr/include/tk.h:23:3: error: #error Tk 8.5 must be compiled with tcl.h from Tcl 8.5 make[2]: *** [wishwn-tkAppInit.o] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 • src/Makefile TK_INCLUDE_SPEC = -I/Library/Frameworks/Tk.framework/Versions/8.4/Headers TCL_INCLUDE_SPEC = -I/Library/Frameworks/Tcl.framework/Versions/8.4/Headers TCL_LIB_SPEC = -F/Library/Frameworks -framework Tcl TK_LIBS = -lpthread -framework CoreFoundation -framework Carbon TK_LIB_SPEC = -F/Library/Frameworks -framework Tk TK_PREFIX = /usr/local TK_XINCLUDES = INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/include $(TCL_INCLUDE_SPEC) $(TK_INCLUDE_SPEC) $(TK_XINCLUDES) -I$(TK_PREFIX)/include wishwn-tkAppInit.o: tkAppInit.c if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(wishwn_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT wishwn-tkAppInit.o -MD -MP -MF "$(DEPDIR)/wishwn-tkAppInit.Tpo" -c -owishwn-tkAppInit.o `test -f 'tkAppInit.c' || echo '$(srcdir)/'`tkAppInit.c; \ then mv -f "$(DEPDIR)/wishwn-tkAppInit.Tpo" "$(DEPDIR)/wishwn-tkAppInit.Po"; else rm -f "$(DEPDIR)/wishwn-tkAppInit.Tpo"; exit 1; fi Not a mere warning. A fatal compilation error

  7. Step 1: Install WordNet 3.0 • sudo make install douglass-dhcp45:WordNet-3.0 sandiway$ sudo make install Password: Making install in doc Making install in html make[3]: Nothing to be done for `install-exec-am'. test -z "/usr/local/WordNet-3.0/doc/html" || /Users/sandiway/research/WordNet-3.0/install-sh -d "/usr/local/WordNet-3.0/doc/html" /usr/bin/install -c -m 644 'binsrch.3WN.html' '/usr/local/WordNet-3.0/doc/html/binsrch.3WN.htm.l … Making install in man make[3]: Nothing to be done for `install-exec-am'. test -z "/usr/local/WordNet-3.0/man/man1" || /Users/sandiway/research/WordNet-3.0/install-sh -d "/usr/local/WordNet-3.0/man/man1" /usr/bin/install -c -m 644 './grind.1' '/usr/local/WordNet-3.0/man/man1/grind.1’ … Making install in pdf make[3]: Nothing to be done for `install-exec-am'. test -z "/usr/local/WordNet-3.0/doc/pdf" || /Users/sandiway/research/WordNet-3.0/install-sh -d "/usr/local/WordNet-3.0/doc/pdf" /usr/bin/install -c -m 644 'binsrch.3.pdf' '/usr/local/WordNet-3.0/doc/pdf/binsrch.3.pdf’ Making install in ps make[3]: Nothing to be done for `install-exec-am'. test -z "/usr/local/WordNet-3.0/doc/ps" || /Users/sandiway/research/WordNet-3.0/install-sh -d "/usr/local/WordNet-3.0/doc/ps" /usr/bin/install -c -m 644 'binsrch.3.ps' '/usr/local/WordNet-3.0/doc/ps/binsrch.3.ps’ make[3]: Nothing to be done for `install-exec-am'. make[3]: Nothing to be done for `install-data-am'. Making install in dict make[2]: Nothing to be done for `install-exec-am'. test -z "/usr/local/WordNet-3.0/dict" || /Users/sandiway/research/WordNet-3.0/install-sh -d "/usr/local/WordNet-3.0/dict” /usr/bin/install -c -m 644 'adj.exc' '/usr/local/WordNet-3.0/dict/adj.exc' /usr/bin/install -c -m 644 'adv.exc' '/usr/local/WordNet-3.0/dict/adv.exc' /usr/bin/install -c -m 644 'cntlist' '/usr/local/WordNet-3.0/dict/cntlist' /usr/bin/install -c -m 644 'cntlist.rev' '/usr/local/WordNet-3.0/dict/cntlist.rev' /usr/bin/install -c -m 644 'data.adj' '/usr/local/WordNet-3.0/dict/data.adj' /usr/bin/install -c -m 644 'data.adv' '/usr/local/WordNet-3.0/dict/data.adv’ /usr/bin/install -c -m 644 'data.noun' '/usr/local/WordNet-3.0/dict/data.noun' /usr/bin/install -c -m 644 'data.verb' '/usr/local/WordNet-3.0/dict/data.verb' /usr/bin/install -c -m 644 'frames.vrb' '/usr/local/WordNet-3.0/dict/frames.vrb' /usr/bin/install -c -m 644 'index.adj' '/usr/local/WordNet-3.0/dict/index.adj' /usr/bin/install -c -m 644 'index.adv' '/usr/local/WordNet-3.0/dict/index.adv' /usr/bin/install -c -m 644 'index.noun' '/usr/local/WordNet-3.0/dict/index.noun' /usr/bin/install -c -m 644 'index.sense' '/usr/local/WordNet-3.0/dict/index.sense' /usr/bin/install -c -m 644 'index.verb' '/usr/local/WordNet-3.0/dict/index.verb' /usr/bin/install -c -m 644 'log.grind.3.0' '/usr/local/WordNet-3.0/dict/log.grind.3.0' /usr/bin/install -c -m 644 'noun.exc' '/usr/local/WordNet-3.0/dict/noun.exc' /usr/bin/install -c -m 644 'sentidx.vrb' '/usr/local/WordNet-3.0/dict/sentidx.vrb' /usr/bin/install -c -m 644 'sents.vrb' '/usr/local/WordNet-3.0/dict/sents.vrb' /usr/bin/install -c -m 644 'verb.Framestext' '/usr/local/WordNet-3.0/dict/verb.Framestext' /usr/bin/install -c -m 644 'verb.exc' '/usr/local/WordNet-3.0/dict/verb.exc' /usr/bin/install -c -m 644 'lexnames' '/usr/local/WordNet-3.0/dict/lexnames' Making install in include Making install in tk make[3]: Nothing to be done for `install-exec-am'. test -z "/usr/local/WordNet-3.0/include/tk" || /Users/sandiway/research/WordNet-3.0/install-sh -d "/usr/local/WordNet-3.0/include/tk" /usr/bin/install -c -m 644 'tk.h' '/usr/local/WordNet-3.0/include/tk/tk.h' /usr/bin/install -c -m 644 'tkDecls.h' '/usr/local/WordNet-3.0/include/tk/tkDecls.h' make[3]: Nothing to be done for `install-exec-am'. test -z "/usr/local/WordNet-3.0/include" || /Users/sandiway/research/WordNet-3.0/install-sh -d "/usr/local/WordNet-3.0/include" /usr/bin/install -c -m 644 'wn.h' '/usr/local/WordNet-3.0/include/wn.h' Making install in lib Making install in wnres make[3]: Nothing to be done for `install-exec-am'. test -z "/usr/local/WordNet-3.0/lib/wnres" || /Users/sandiway/research/WordNet-3.0/install-sh -d "/usr/local/WordNet-3.0/lib/wnres" /usr/bin/install -c -m 644 'license.txt' '/usr/local/WordNet-3.0/lib/wnres/license.txt' /usr/bin/install -c -m 644 'wn.xbm' '/usr/local/WordNet-3.0/lib/wnres/wn.xbm' /usr/bin/install -c -m 644 'wnb.man' '/usr/local/WordNet-3.0/lib/wnres/wnb.man' /usr/bin/install -c -m 644 'wngloss.man' '/usr/local/WordNet-3.0/lib/wnres/wngloss.man' test -z "/usr/local/WordNet-3.0/lib" || /Users/sandiway/research/WordNet-3.0/install-sh -d "/usr/local/WordNet-3.0/lib" /usr/bin/install -c -m 644 'libWN.a' '/usr/local/WordNet-3.0/lib/libWN.a' ranlib '/usr/local/WordNet-3.0/lib/libWN.a' make[3]: Nothing to be done for `install-data-am'. Making install in src test -z "/usr/local/WordNet-3.0/bin" || /Users/sandiway/research/WordNet-3.0/install-sh -d "/usr/local/WordNet-3.0/bin" /usr/bin/install -c 'wn' '/usr/local/WordNet-3.0/bin/wn' /usr/bin/install -c 'wishwn' '/usr/local/WordNet-3.0/bin/wishwn' test -z "/usr/local/WordNet-3.0/bin" || /Users/sandiway/research/WordNet-3.0/install-sh -d "/usr/local/WordNet-3.0/bin" /usr/bin/install -c 'wnb' '/usr/local/WordNet-3.0/bin/wnb’

  8. Step 1: Install WordNet 3.0 • Set the PATH $ ls /usr/local/WordNet-3.0/bin/ wishwnwnwnb $ export PATH=/usr/local/WordNet-3.0/bin:$PATH $ printenv PATH /usr/local/WordNet-3.0/bin:/Users/sandiway/bin:/usr/local/sicstus4/bin:/opt/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin • Set the PATH permanently • ~/.bash-login ulimit -d unlimited export PATH=/Users/sandiway/bin:/usr/local/sicstus4/bin:/opt/local/bin:/usr/local/WordNet-3.0/bin:$PATH $ wnb

  9. Step 2: Install an Language Interface EXERCISE FOR THE READER Perl (similar things exist for Python) Requires installing WordNet 3.0

  10. Step 3: Measuring Similarity Requires installing WordNet::QueryData first

  11. Example: Rolling your own • Based on WordNet 1.7.1 • Example: • happy/a is in [happy] • happy and unhappy/a are antonyms • For [unhappy], see also [sad] • sad/a is in the synset [sad] • happy/a is in [happy] • For [happy], see also [glad] • glad and sad/a are antonyms • happy/s is in [happy,pleased][happy,pleased] and [glad] are similar • glad and sad/a are antonyms

  12. Example: Rolling your own • Full graph: • does full breadth-first search…

  13. Using WordNet

  14. Using WordNet: Example

  15. Using WordNet: Example

  16. Using WordNet: Example

  17. Using WordNet: Example

  18. Using WordNet: Example

  19. Using WordNet: Example

  20. Using WordNet: Example

  21. Using WordNet: Example

More Related