Package: ics-pkg
ICS - Interactive Classification SystemThe Interactive Classification System (ICS), is a web-based application that supports the activity
of manual text classification, i.e., labeling documents according to their content.The system is designed to give total freedom of action to its users: they can at any time modify any classification
schema and any label assignment, possibly reusing any relevant information from previous activities.The application uses machine learning to actively support its users with classification suggestions The machine learning
component of the system is an unobtrusive observer of the users' activities, never interrupting them, constantly
adapting and updating its models in response to their actions, and always available to perform automatic
classifications.PublicationInstallationStarting the main appLoginConfigurationAdditional appsVideo tutorialsLicensePublicationICS is described in the paper:A. Esuli, "ICS: Total Freedom in Manual Text Classification Supported by Unobtrusive Machine Learning," in IEEE Access, vol. 10, pp. 64741-64760, 2022, doi: 10.1109/ACCESS.2022.3184009InstallationYou can have a working installation of ICS in many ways:Single file executable(to start using ICS)Docker(for a single user)Docker compose(for larger installation)Pip installFrom sourceSingle file executableExecutable files of ICS are downloadable from thereleases page.
Once downloaded it can be run and have a working instance of ICS, provided adatabase is configured.ics-webappThe executable are from source usingpyinstaller:pyinstaller-Fics\scripts\webapp.py--add-data="ics\apps\media;ics\apps\media"--collect-allsklearn--nameics-webappDockerA quick way have a running instance of ICS is to useDocker.dockerrun-p8080:8080ghcr.io/aesuli/icsThis command pulls the ICS image from Docker hub and runs it, publishing the application on port 8080 of the host machine, accessible from any interface.
Once started ICS is accessible from the host machine using a browser at the addresshttp://127.0.0.1:8080To have ICS accessible only from the local host machine add local ip address:dockerrun-p127.0.0.1:8080:8080ghcr.io/aesuli/icsNOTE:by default the ICS image uses the SQLite database engine, which may result in reduced efficiency and functionalities.
A configuration using PostgreSQL is strongly recommended. It can be easily set up using docker compose.Data persistenceICS image use volumes to keep information persistent:ics-db stores the sqlite file, this is the only volume that should be saved to keep the state of the application.ics-data stores the files that are uploaded or downloaded from the system. It is defined for inspection in case of failures, it is not necessary to save it.ics-log stores the log files. It is defined for inspection in case of failures, it is not necessary to save it.Docker composeAn instance of ICS using PostgreSQL can be obtained downloading thedocker-compose.ymlfile to a local directory and runningdockercomposeupfrom that directory.Host and portThe environment variablesICS_HOSTandICS_PORTdefine the interface and port on which ICS is accessible on the host machine.
Default is 127.0.0.1 and 8080.Data persistenceThe compose-based version of ICS use volumes to keep information persistent:db-data stores the PostgreSQL, this is the only volume that should be saved to keep the state of the application.ics-data stores the files that are uploaded or downloaded from the system. It is defined for inspection in case of failures, it is not necessary to save it.ics-log stores the log files. It is defined for inspection in case of failures, it is not necessary to save it.A volume can be linked to a path on the host machine by defining an environment variable (or by editing the docker-compose.yml file):DB_DATA for the db-data volume (recommended)ICS_DATA for the ics-data volume (not necessary)ICS_LOG for the ics-log volume (not necessary)For example, on Windows:setDB_DATA=D:\ics_db_data
dockercomposeupOn Linux/Mac:DB_DATA=/var/lib/ics/datadockercomposeupPipThe suggested way to quickly set up the python environment is to use
theAnaconda/Miniconda distributionand thecondapackage manager to
create the virtual enviroment.condacreate-nicspython
condaactivateicsICS is published as apippackage.pipinstallics-pkgThe last required step is toconfigure a database.From sourceDownload source code fromGitHub repo.
Create a virtual environment and install the required packages.cd[directorywithICScode]condacreate-nicspython
condaactivateics
pipinstall-rrequirements.txtThe last required step is toconfigure a database.DB configurationThe Docker compose installation already includes the setup of the PostgreSQL database, so you can skip this section.
Any another requires to have a database available to connect to.
The use ofPostgreSQLis strongly recommended.PostgreSQLTo connect to PostgreSQL, a dedicated DB must be created.
These are the SQL commands to create the required user and database on PostgreSQL.CREATE USER ics WITH PASSWORD 'ics';
CREATE DATABASE ics;
GRANT ALL PRIVILEGES ON DATABASE ics to ics;These commands can be issued using thepsqlSQL shell (or using pgAdmin, or similar db frontends).
The tables required by ICS are created automatically at the first run.Then ICS can be launched passing the DB connection string:ics-webapp--db_connection_stringpostgresql://ics:ics@localhost:5432/icsThe above connection string is the correct one for a locally running database, change it according to your configuration.SQLiteBy default ICS uses SQLite as the DB, yet please note thatthe use of SQLite is intended only for a first exploration of ICS and that using PostgreSQL is strongly recommended.
Using SQLite can result in reduced efficiency and some functionalities may be missing or not properly working.To use SQLite use the following--db_connection_stringargument to the launch script:ics-webapp--db_connection_stringsqlite:///ics.sqliteThis is the default connection string, it creates the DB file in the current working directory.
Change it to point to the path where you want to store your file.Again, PostgreSQL is the recommended database.The main appRunning the docker image automatically starts the main application, which can be accessed with a browser at the ip and
port defined with the docker launch command or docker compose file.
Installations that do not use docker can run ics by using the ics-webapp script.Activate the virtual environment:condaactivateicsWhen installed usingpip, the main application can be started with the command:ics-webappWhen working on source code, it can be launched from theics-webapp.pyscript:Linux/Mac:PYTHONPATH=.pythonics/scripts/ics-webapp.pyWindows:setPYTHONPATH=.pythonics/scripts/ics-webapp.pyWhen launched, the app will print the URL at which it is accessible.[30/Mar/2022:15:31:59] ENGINE Bus STARTING
[30/Mar/2022:15:31:59] ENGINE Started monitor thread 'Autoreloader'.
[30/Mar/2022:15:31:59] ENGINE Serving on http://127.0.0.1:8080
[30/Mar/2022:15:31:59] ENGINE Bus STARTED
[30/Mar/2022:15:31:59] ENGINE Started monitor thread 'Session cleanup'.LoginAfter the installation, only theadminuser is defined, with passwordadminadmin.
Change the default password on the first run.ConfigurationA configuration forics-webappcan be saved to a file using the-sargument with the filename to use. For example,
this command creates adefault.conffile that lists all the default values (if any other argument is used in the
command, the value of the argument is saved in the configuration file).ics-webapp-sdefault.confA configuration file can be used to set the launch arguments, using the-cargument:ics-webapp-cmyinstance.confAny additional argument passed on the command line overrides the one specified in the configuration file.Additional appsThese apps are clients that connect to the ICS web applications.If you run ICS from Docker you must install them in a local python environment (pip install ics-pkg, note that you don't need to set up the DB for them)If ICS is not running on the local machine with default port, you must use the--host [ip address or name]and/or the--port [number]arguments.Command line interfaceWhen the ics-webapp is running, ICS can be also accessed from command line> ics-cli
Welcome, type help to have a list of commands
> login admin
Password: 
'Ok'
>Twitter stream collectorA command line app, based onTwiGet, automatically upload to ICS the tweets
collected from filtered stream queries.> ics-twitter-uploader
Logging into http://127.0.0.1:8080/service/userauth/
Username: admin
Password: 
TwiGet 0.1.5

Available commands (type help <command> for details):
create, delete, exit, help, list, refresh, start, stop

Reminder: add -is:retweet to a rule to exclude retweets from results, and to get only original content.
Registered queries:
        no registered queries

[not collecting (0 since last start)]>Video tutorialsThis YouTube playlistcollects videos showing what you can do with ICS.LicenseThis software is licensed under the3-Clause BSD licenseunless
otherwise noted.