argument-graph-mining icon indicating copy to clipboard operation
argument-graph-mining copied to clipboard

I can't run the program

Open AntonioDLC opened this issue 1 year ago • 4 comments

I get error from both docker and poetry. From docker I get:

sudo docker-compose run app python -m recap_am.server [sudo] password for tuan: Building app Step 1/8 : FROM python:3.7-slim ---> a255ffcb469f Step 2/8 : ENV POETRY_VERSION=1.0.0 ---> Using cache ---> e03c6ec65256 Step 3/8 : WORKDIR /app ---> Using cache ---> ce8804c5688e Step 4/8 : RUN apt update && apt install -y --no-install-recommends graphviz && rm -rf /var/lib/apt/lists/* ---> Using cache ---> 3286e75c31bf Step 5/8 : RUN pip install "poetry==${POETRY_VERSION}" && poetry config virtualenvs.create false ---> Using cache ---> 655095f1f764 Step 6/8 : COPY poetry.lock* pyproject.toml ./ ---> Using cache ---> ff9289d788ff Step 7/8 : RUN poetry install --no-interaction --no-ansi ---> Running in a0b4ef26aa59 Skipping virtualenv creation, as specified in config file. Installing dependencies from lock file

Package operations: 66 installs, 8 updates, 0 removals

  • Updating six (1.16.0 -> 1.14.0)
  • Installing docutils (0.15.2)
  • Installing jmespath (0.9.5)
  • Installing python-dateutil (2.8.1)
  • Updating urllib3 (2.0.7 -> 1.25.9)
  • Installing botocore (1.15.48)
  • Updating zipp (3.15.0 -> 3.1.0)
  • Updating certifi (2024.7.4 -> 2020.4.5.1)
  • Installing chardet (3.0.4)
  • Installing click (7.1.2)
  • Installing cymem (2.0.3)
  • Updating idna (3.7 -> 2.9)
  • Updating importlib-metadata (0.23 -> 1.6.0)
  • Installing joblib (0.14.1) ... (skipping a few lines)
  • Installing werkzeug (1.0.1)
  • Installing black (18.9b0)
  • Installing edlib (1.3.8.post1)

[EnvCommandError] Command ['/usr/local/bin/python', '-m', 'pip', 'install', '--no-deps', 'edlib==1.3.8.post1'] errored with the following return code 1, and output: Collecting edlib==1.3.8.post1 Downloading edlib-1.3.8.post1.tar.gz (93 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 93.6/93.6 kB 1.3 MB/s eta 0:00:00 Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Building wheels for collected packages: edlib Building wheel for edlib (setup.py): started Building wheel for edlib (setup.py): finished with status 'error' error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [11 lines of output] running bdist_wheel running build running build_ext building 'edlib' extension creating build creating build/temp.linux-x86_64-3.7 creating build/temp.linux-x86_64-3.7/edlib creating build/temp.linux-x86_64-3.7/edlib/src gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iedlib/include -I/usr/local/include/python3.7m -c edlib.bycython.cpp -o build/temp.linux-x86_64-3.7/edlib.bycython.o -O3 -std=c++11 unable to execute 'gcc': No such file or directory error: command 'gcc' failed with exit status 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for edlib Running setup.py clean for edlib Failed to build edlib Installing collected packages: edlib Running setup.py install for edlib: started Running setup.py install for edlib: finished with status 'error' error: subprocess-exited-with-error

× Running setup.py install for edlib did not run successfully. │ exit code: 1 ╰─> [11 lines of output] running install running build running build_ext building 'edlib' extension creating build creating build/temp.linux-x86_64-3.7 creating build/temp.linux-x86_64-3.7/edlib creating build/temp.linux-x86_64-3.7/edlib/src gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iedlib/include -I/usr/local/include/python3.7m -c edlib.bycython.cpp -o build/temp.linux-x86_64-3.7/edlib.bycython.o -O3 -std=c++11 unable to execute 'gcc': No such file or directory error: command 'gcc' failed with exit status 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> edlib

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

[notice] A new release of pip is available: 23.0.1 -> 24.0 [notice] To update, run: pip install --upgrade pip

ERROR: Service 'app' failed to build : The command '/bin/sh -c poetry install --no-interaction --no-ansi' returned a non-zero code: 1

And from poetry I get:

poetry run python -m recap_am.server Traceback (most recent call last): File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/home/tuan/Documents/Repos/argument-graph-mining/recap_am/server.py", line 1, in from recap_am import app File "/home/tuan/Documents/Repos/argument-graph-mining/recap_am/app.py", line 15, in import recap_argument_graph as ag ModuleNotFoundError: No module named 'recap_argument_graph'

AntonioDLC avatar Jul 09 '24 13:07 AntonioDLC

I have zero experience using docker or poetry. I get that docker is some sort of container program but I never really had the need to use it. If this error is not something you have the will or time to look into, could you send me a couple examples of input and output data you got from this? I'm particularly interested in generating a graph for this document: https://nap.nationalacademies.org/catalog/10490/dietary-reference-intakes-for-energy-carbohydrate-fiber-fat-fatty-acids-cholesterol-protein-and-amino-acids I manually made one but it took a lot of effort even for a single short claim: https://antoniodlc.github.io/alimenergia_plus_docuparts_horizontal.svg

AntonioDLC avatar Jul 09 '24 13:07 AntonioDLC

Sorry to hear that! I think the main problem will be that the package recap-argument-graph is no longer maintained and even seems to have been removed from PyPI. It has been superseded by arguebuf, but arguebuf needs newer Python versions than this software supports. I am currently quite busy with other projects, but would love to see this application working again. I will add it to my TODO list and investigate the issue once I have some spare time 😄

For the time being: I was able to get quite promising-looking argument graphs using ChatGPT. You could try to extract the plain text of the mentioned document and prompt the LLM to generate a graph structure out of it.

mirkolenz avatar Jul 09 '24 14:07 mirkolenz

Thanks! I was actually looking into that too. The gpt graphs suck IMO plus they take a long while to generate. But maybe it's because of my prompts.

I guess it's only a matter of time before the data for training one of these LLM for this specific task is created and fed to it? I'm going to keep trying prompts and searching for papers or investigations ongoing around this matter then. Took me a while to realize the keywords for this whole thing were "argument mining" and "argument graph".

If you know any way I can join a group to contribute to investigations on how to automate the argument graphing of the current scientific corpus let me know!

AntonioDLC avatar Jul 09 '24 14:07 AntonioDLC

Yeah, LLM-generated graphs have some issues and it indeed quite slow. I will let you know about any progress I make, but it could take some time, sadly. I recently published a conference paper on using LLMs to do the relation prediction (support/attack) for argument graphs. I will send you a link to it once it is available (should be in August), it contains a comparison of some prompting strategies that may be of value for you!

mirkolenz avatar Jul 09 '24 14:07 mirkolenz

Sorry for the long delay, but I finally got some good news to share with you: I was able to get the project working again 😄 In the process, I switched over to using uv for package management, reworked the Dockerfile, embedded the final release of the recap-argument-graph package into the repo, and also renamed the module to the more intuitive argmining.

While I was at it, I added support for querying the end-to-end pipeline via gRPC through our recently published microservice framework for argumentation machines: arg-services. That should make it easier to integrate in downstream applications.

Feel free to close the issue if it's working for you as well, otherwise let me know about any remaining issues trying to get this up and running.

PS: As promised, here are two other of my works where I experimented with using LLMs for the argument mining task in case you're interested:

mirkolenz avatar Mar 24 '25 09:03 mirkolenz

Spectacular, thanks for sharing! I did manage to run it also! However I had to change the [flask] port at settings.toml to something other than 80 since I have that port busy for some reason in Ubuntu (I checked and I just get a forbidden answer, idk what's being hosted locally and if it's a common thing for ubuntu). Closing since this is no longer a problem :)

AntonioDLC avatar Mar 24 '25 23:03 AntonioDLC

Thanks for the feedback! I updated the default port to 8000 in case others run into this issue as well.

mirkolenz avatar Mar 25 '25 10:03 mirkolenz