Skip to content

Commit 3115332

Browse files
aphedgesmitchelldehavenyash-reddyjoecummingsdanny911kr
committed
Add source code for NAACL 2021 paper
Co-authored-by: Mitchell DeHaven <[email protected]> Co-authored-by: yash-reddy <[email protected]> Co-authored-by: Joe Cummings <[email protected]> Co-authored-by: Dongho Lee <[email protected]> Co-authored-by: Manuel R. Ciosici <[email protected]>
1 parent f3225b6 commit 3115332

File tree

149 files changed

+31826
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+31826
-1
lines changed

CITATION.cff

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
cff-version: 1.2.0
2+
title: Machine-Assisted Script Curation (MASC)
3+
abstract: A web application for curating scripts
4+
type: software
5+
repository-code: https://github.com/isi-vista/MASC
6+
license: MIT
7+
message: If you use this software, please cite the paper from preferred-citation.
8+
authors:
9+
- given-names: Manuel
10+
family-names: Ciosici
11+
affiliation: USC Information Sciences Institute
12+
- given-names: Joseph
13+
family-names: Cummings
14+
affiliation: USC Information Sciences Institute
15+
- given-names: Mitchell
16+
family-names: DeHaven
17+
affiliation: USC Information Sciences Institute
18+
- given-names: Alex
19+
family-names: Hedges
20+
affiliation: USC Information Sciences Institute
21+
- given-names: Yash
22+
family-names: Kankanampati
23+
affiliation: USC Information Sciences Institute
24+
- given-names: Dong-Ho
25+
family-names: Lee
26+
affiliation: USC Information Sciences Institute
27+
- given-names: Ralph
28+
family-names: Weischedel
29+
affiliation: USC Information Sciences Institute
30+
- given-names: Marjorie
31+
family-names: Freedman
32+
affiliation: USC Information Sciences Institute
33+
preferred-citation:
34+
authors:
35+
- given-names: Manuel
36+
family-names: Ciosici
37+
affiliation: USC Information Sciences Institute
38+
- given-names: Joseph
39+
family-names: Cummings
40+
affiliation: USC Information Sciences Institute
41+
- given-names: Mitchell
42+
family-names: DeHaven
43+
affiliation: USC Information Sciences Institute
44+
- given-names: Alex
45+
family-names: Hedges
46+
affiliation: USC Information Sciences Institute
47+
- given-names: Yash
48+
family-names: Kankanampati
49+
affiliation: USC Information Sciences Institute
50+
- given-names: Dong-Ho
51+
family-names: Lee
52+
affiliation: USC Information Sciences Institute
53+
- given-names: Ralph
54+
family-names: Weischedel
55+
affiliation: USC Information Sciences Institute
56+
- given-names: Marjorie
57+
family-names: Freedman
58+
affiliation: USC Information Sciences Institute
59+
title: Machine-Assisted Script Curation
60+
type: conference-paper
61+
collection-title:
62+
"Proceedings of the 2021 Conference of the North American Chapter
63+
of the Association for Computational Linguistics: Human Language Technologies:
64+
Demonstrations"
65+
collection-type: proceedings
66+
publisher:
67+
name: Association for Computational Linguistics
68+
year: 2021
69+
month: 6
70+
start: 8
71+
end: 17
72+
doi: 10.18653/v1/2021.naacl-demos.2
73+
url: https://aclanthology.org/2021.naacl-demos.2
74+
abstract:
75+
We describe Machine-Aided Script Curator (MASC), a system for human-machine
76+
collaborative script authoring. Scripts produced with MASC include (1) English
77+
descriptions of sub-events that comprise a larger, complex event; (2) event types
78+
for each of those events; (3) a record of entities expected to participate in
79+
multiple sub-events; and (4) temporal sequencing between the sub-events. MASC
80+
automates portions of the script creation process with suggestions for event types,
81+
links to Wikidata, and sub-events that may have been forgotten. We illustrate
82+
how these automations are useful to the script writer with a few case-study scripts.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 USC Information Sciences Institute
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
default:
2+
@echo "an explicit target is required"
3+
4+
SHELL=/usr/bin/env bash
5+
6+
check:
7+
cd angular-frontend && \
8+
make check && \
9+
cd ../kairos-yaml && \
10+
make check && \
11+
cd ../pycurator && \
12+
make check
13+
14+
precommit:
15+
cd angular-frontend && \
16+
make precommit && \
17+
cd ../kairos-yaml && \
18+
make precommit && \
19+
cd ../pycurator && \
20+
make precommit
21+
22+
update:
23+
cd angular-frontend && \
24+
make update && \
25+
cd ../pycurator && \
26+
make update
27+
28+
install:
29+
cd angular-frontend && \
30+
make install && \
31+
cd ../pycurator && \
32+
make install

README.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11
# Machine-Assisted Script Curation (MASC)
22

3-
The implementation is currently being prepared for release. For more information about the project, see our paper:
3+
The MASC schema curation tool is currently being developed for the LESTAT project.
4+
5+
## Requirements
6+
7+
Python must be installed. It currently runs on Python 3.7, but newer versions might work as well.
8+
9+
NodeJS v14 and npm v6 must be installed. Tools like [nodenv](https://github.com/nodenv/nodenv) or [nvm](https://github.com/nvm-sh/nvm) can be used for installation. For alternative methods, refer to the NodeSource blog posts [Installing Node.js Tutorial: Using nvm](https://nodesource.com/blog/installing-node-js-tutorial-using-nvm-on-mac-os-x-and-ubuntu/) (macOS and Ubuntu) or [Installing Node.js Tutorial: Windows](https://nodesource.com/blog/installing-nodejs-tutorial-windows/) (Windows) for instructions.
10+
11+
## Installation
12+
13+
Use the provided Makefile to install MASC:
14+
15+
```bash
16+
make install
17+
```
18+
19+
To configure deployment-specific settings, create `pycurator/.env` and add settings specified in `pycurator/common/config.py`.
20+
21+
## Usage
22+
23+
The application has two main components, and they must be run simultaneously to use the application:
24+
25+
- To run the back end, navigate to `pycurator/flask_backend` and run `bash start_gunicorn.sh`. The server will be available at `http://localhost:5000/`. Usage of the Flask server is possible, but due to a bug in `sentence-transformers`, the application might crash when run with Flask instead of Gunicorn.
26+
- To run the front end, navigate to `angular-frontend` and run `npx ng serve`. The application will be hosted at `http://localhost:4200/`, which is viewable in a modern web browser. The application will automatically reload if any source files are changed.
27+
28+
While these instructions are sufficient for a local deployment, they should not be used on an actual server. It is up to the user to determine the proper server configuration for themselves.
29+
30+
### GPT-2 component
31+
32+
The GPT-2 component currently must be run manually.
33+
34+
It is recommended to use the `batch_run.py` script to do so. It automatically finds all schemas without a JSON file and runs a Slurm job for each. It doesn't use anything but the standard library, so the virtual environment is not necessary.
35+
36+
`batch_run.py` must be run from `pycurator/gpt2_component` to allow paths to work properly. Use the command `PYTHONPATH=../../ python -m pycurator.gpt2_component.batch_run`.
37+
38+
Do not start a new run until all previous jobs are finished. `batch_run.py` only checks whether there is output when deciding which schemas to run, so it can't tell if there is a currently running job for a schema.
39+
40+
## Publications
41+
42+
For more information about the project, see the related paper:
443

544
> Ciosici, Manuel, et al. "Machine-Assisted Script Curation." _Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies: Demonstrations_, Association for Computational Linguistics, 2021, pp. 8–17. _ACLWeb_, <https://www.aclweb.org/anthology/2021.naacl-demos.2>.
45+
46+
## License
47+
48+
[MIT](https://choosealicense.com/licenses/mit/)

angular-frontend/.browserslistrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
16+
Firefox ESR
17+
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
18+
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.

angular-frontend/.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

angular-frontend/.eslintrc.json

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["projects/**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts"],
7+
"parserOptions": {
8+
"project": ["tsconfig.app.json", "tsconfig.spec.json", "e2e/tsconfig.json"],
9+
"createDefaultProgram": true
10+
},
11+
"extends": [
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/recommended",
14+
"plugin:import/errors",
15+
"plugin:import/warnings",
16+
"plugin:import/typescript",
17+
"plugin:@angular-eslint/recommended",
18+
"prettier",
19+
"prettier/@typescript-eslint"
20+
],
21+
"plugins": ["deprecation", "import", "jsdoc"],
22+
"rules": {
23+
"@angular-eslint/component-selector": [
24+
"error",
25+
{ "type": "element", "prefix": "app", "style": "kebab-case" }
26+
],
27+
"@angular-eslint/directive-selector": [
28+
"error",
29+
{ "type": "attribute", "prefix": "app", "style": "camelCase" }
30+
],
31+
"@angular-eslint/no-empty-lifecycle-method": "off",
32+
"@angular-eslint/use-component-view-encapsulation": "error",
33+
"@angular-eslint/use-pipe-decorator": "error",
34+
"@typescript-eslint/consistent-type-definitions": "error",
35+
"@typescript-eslint/dot-notation": "off",
36+
"@typescript-eslint/explicit-member-accessibility": [
37+
"off",
38+
{ "accessibility": "explicit" }
39+
],
40+
"@typescript-eslint/member-ordering": [
41+
"error",
42+
{ "default": { "memberTypes": ["signature", "field", "constructor", "method"] } }
43+
],
44+
"@typescript-eslint/naming-convention": [
45+
"error",
46+
{ "selector": "variable", "format": ["camelCase", "snake_case", "UPPER_CASE"] }
47+
],
48+
"@typescript-eslint/no-empty-function": ["error", { "allow": ["constructors"] }],
49+
"@typescript-eslint/no-inferrable-types": ["error", { "ignoreParameters": true }],
50+
"@typescript-eslint/no-non-null-assertion": "error",
51+
"@typescript-eslint/no-this-alias": "error",
52+
"@typescript-eslint/quotes": ["error", "single", { "avoidEscape": true }],
53+
"capitalized-comments": [
54+
"error",
55+
"always",
56+
{ "ignorePattern": "import", "ignoreConsecutiveComments": true }
57+
],
58+
"consistent-return": "error",
59+
"curly": ["error", "all"],
60+
"default-case": "error",
61+
"default-case-last": "error",
62+
"deprecation/deprecation": "warn",
63+
"eqeqeq": "error",
64+
"import/no-extraneous-dependencies": "error",
65+
"import/no-internal-modules": "off",
66+
"import/order": ["error", { "alphabetize": { "order": "asc", "caseInsensitive": true } }],
67+
"jsdoc/no-types": "error",
68+
"new-parens": "off",
69+
"no-alert": "error",
70+
"no-bitwise": "error",
71+
"no-console": ["error", { "allow": ["error", "warn"] }],
72+
"no-duplicate-case": "error",
73+
"no-duplicate-imports": "error",
74+
"no-else-return": "error",
75+
"no-empty-function": "off",
76+
"no-eval": "error",
77+
"no-extra-bind": "error",
78+
"no-implicit-coercion": "error",
79+
"no-implicit-globals": "error",
80+
"no-implied-eval": "error",
81+
"no-label-var": "error",
82+
"no-lone-blocks": "error",
83+
"no-lonely-if": "error",
84+
"no-new-func": "error",
85+
"no-param-reassign": "error",
86+
"no-redeclare": "error",
87+
"no-restricted-imports": ["error", "rxjs/Rx"],
88+
"no-return-assign": "error",
89+
"no-return-await": "error",
90+
"no-script-url": "error",
91+
"no-self-compare": "error",
92+
"no-sequences": "error",
93+
"no-shadow": "error",
94+
"no-sparse-arrays": "error",
95+
"no-template-curly-in-string": "error",
96+
"no-throw-literal": "error",
97+
"no-unreachable-loop": "error",
98+
"no-unused-expressions": "error",
99+
"no-unneeded-ternary": "error",
100+
"no-use-before-define": "error",
101+
"no-useless-backreference": "error",
102+
"no-useless-concat": "error",
103+
"no-useless-return": "error",
104+
"no-var": "error",
105+
"no-void": "error",
106+
"prefer-object-spread": "error",
107+
"quote-props": ["error", "as-needed"],
108+
"sort-imports": ["error", { "ignoreCase": true, "ignoreDeclarationSort": true }],
109+
"spaced-comment": ["error", "always", { "exceptions": ["*"] }],
110+
"strict": "error"
111+
}
112+
},
113+
{
114+
"files": ["*.html"],
115+
"extends": ["plugin:@angular-eslint/template/recommended"],
116+
"rules": {}
117+
}
118+
]
119+
}

angular-frontend/.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events*.json
15+
speed-measure-plugin*.json
16+
17+
# IDEs and editors
18+
/.idea
19+
.project
20+
.classpath
21+
.c9/
22+
*.launch
23+
.settings/
24+
*.sublime-workspace
25+
26+
# IDE - VSCode
27+
.vscode/*
28+
!.vscode/settings.json
29+
!.vscode/tasks.json
30+
!.vscode/launch.json
31+
!.vscode/extensions.json
32+
.history/*
33+
34+
# misc
35+
/.sass-cache
36+
/connect.lock
37+
/coverage
38+
/libpeerconnection.log
39+
npm-debug.log
40+
yarn-error.log
41+
testem.log
42+
/typings
43+
44+
# System Files
45+
.DS_Store
46+
Thumbs.db

angular-frontend/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

0 commit comments

Comments
 (0)