{"id":90,"date":"2026-11-07T01:54:15","date_gmt":"2026-11-07T01:54:15","guid":{"rendered":"https:\/\/www.ecsow.com\/blog\/?p=90"},"modified":"2026-11-07T02:34:36","modified_gmt":"2026-11-07T02:34:36","slug":"customize-rules-teaching-ai-what-to-detect","status":"publish","type":"post","link":"https:\/\/www.ecsow.com\/blog\/customize-rules-teaching-ai-what-to-detect\/","title":{"rendered":"Customizing rules.tsv: Teaching Ecsow&#8217;s AI What to Detect"},"content":{"rendered":"<div style=\"border:1px solid #e2e7ee;border-radius:6px;padding:16px 20px;background:#fafbfc;margin:0 0 30px\">\n<div style=\"font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:#8a94a3;margin-bottom:8px\">The short version<\/div>\n<div style=\"font-size:12.5px;color:#4b5563;line-height:1.7\">The AI hears words. A file called rules.tsv decides what those words mean. It sits in the Ecsow install folder, one rule per line, three columns: label, weight, phrase. Separated by Tab, saved as UTF-8, and loaded only at startup \u2014 so a restart is part of every edit. A score of 4 is the bar. Get that far and the call is classified.<\/div>\n<\/div>\n<p>Ecsow&#8217;s AI detection does two separate jobs. First it turns speech into text. Then it decides what the text means: a person, a voicemail, a screening assistant, a transfer message, or a phone menu.<\/p>\n<p>The second job is a plain text file. You can edit it with Notepad. That is what this page is about.<\/p>\n<div style=\"margin:26px 0;padding:15px 18px;border:1px solid #e2e7ee;border-left:3px solid #0f766e;border-radius:6px;background:#fafbfc\">\n<div style=\"font-size:14px;color:#374151;line-height:1.75\"><strong>Reference document:<\/strong> the full rules.tsv guide, with every label, weight and worked example. <a href=\"https:\/\/www.ecsow.com\/blog\/wp-content\/uploads\/2026\/11\/rules-tsv-customization-en-1.pdf\" style=\"color:#2563EB\">Download the PDF<\/a> and keep it next to the file while you edit.<\/div>\n<\/div>\n<h2>Where the file lives<\/h2>\n<p><code>rules.tsv<\/code> sits in the folder where you installed Ecsow. Open that folder and you will find it next to the program.<\/p>\n<p>There is a second place it can be set: the <strong>Rules file<\/strong> field in <strong>Tools &gt; Options &gt; Voice Activity Detection &gt; AI Settings<\/strong>. If that field points somewhere else, your edits to the install-folder copy do nothing. Check it once and you will not lose an afternoon to it.<\/p>\n<h2>Three columns, five labels<\/h2>\n<p>Each line is one rule. Three columns, separated by a single Tab character:<\/p>\n<pre style=\"background:#f7f9fb;border:1px solid #e8ecf1;border-radius:6px;padding:14px 16px;font-size:13px;line-height:1.9;overflow-x:auto;white-space:pre;margin:16px 0\">S\t4\twho is calling\nH\t4\tthis is he\nVM\t5\tleave a message after the tone\nT\t5\tplease hold while i connect you\nIVR\t5\tpress 1<\/pre>\n<p>Read the first line as: label <strong>S<\/strong>, weight 4, phrase &#8220;who is calling&#8221;.<\/p>\n<div style=\"margin:20px 0;border:1px solid #e8ecf1;border-radius:6px;overflow:hidden\">\n<div style=\"display:flex;padding:11px 16px;background:#f7f9fb;border-bottom:1px solid #e8ecf1;font-size:11.5px;letter-spacing:.08em;text-transform:uppercase;color:#8a94a3\"><span style=\"flex:0 0 70px\">Label<\/span><span style=\"flex:1 1 auto\">What it means<\/span><span style=\"flex:0 0 150px;text-align:right\">What happens next<\/span><\/div>\n<div style=\"display:flex;padding:11px 16px;border-bottom:1px solid #f0f3f6;font-size:13.5px;color:#374151\"><span style=\"flex:0 0 70px;font-weight:700\">H<\/span><span style=\"flex:1 1 auto\">A live person<\/span><span style=\"flex:0 0 150px;text-align:right\">Your agent is connected<\/span><\/div>\n<div style=\"display:flex;padding:11px 16px;border-bottom:1px solid #f0f3f6;font-size:13.5px;color:#374151\"><span style=\"flex:0 0 70px;font-weight:700\">VM<\/span><span style=\"flex:1 1 auto\">Voicemail or answering machine<\/span><span style=\"flex:0 0 150px;text-align:right\">It leaves your message<\/span><\/div>\n<div style=\"display:flex;padding:11px 16px;border-bottom:1px solid #f0f3f6;font-size:13.5px;color:#374151\"><span style=\"flex:0 0 70px;font-weight:700\">S<\/span><span style=\"flex:1 1 auto\">Screening assistant, like Google&#8217;s<\/span><span style=\"flex:0 0 150px;text-align:right\">It plays your short reply<\/span><\/div>\n<div style=\"display:flex;padding:11px 16px;border-bottom:1px solid #f0f3f6;font-size:13.5px;color:#374151\"><span style=\"flex:0 0 70px;font-weight:700\">T<\/span><span style=\"flex:1 1 auto\">&#8220;Please hold while I transfer you&#8221;<\/span><span style=\"flex:0 0 150px;text-align:right\">It waits for the transfer<\/span><\/div>\n<div style=\"display:flex;padding:11px 16px;font-size:13.5px;color:#374151\"><span style=\"flex:0 0 70px;font-weight:700\">IVR<\/span><span style=\"flex:1 1 auto\">A keypad menu: &#8220;press 1 for sales&#8221;<\/span><span style=\"flex:0 0 150px;text-align:right\">It hangs up<\/span><\/div>\n<\/div>\n<p>Those five letters are the whole vocabulary. Everything else in the file describes how strongly a phrase points at one of them.<\/p>\n<h2>Weights, and the number 4<\/h2>\n<p>The weight says how much you trust a phrase. Each match adds its weight to that label&#8217;s score. The call is only classified once a score reaches 4.<\/p>\n<p>So one weight-5 phrase is enough on its own. Two weight-2 phrases also get there. A single weight-2 phrase does not, and that is on purpose \u2014 it stops one loose word from deciding a call.<\/p>\n<p>Keep weights between 1 and 5:<\/p>\n<ul>\n<li><strong>5<\/strong> \u2014 a complete sentence that could barely mean anything else, like &#8220;leave a message after the tone&#8221;<\/li>\n<li><strong>4<\/strong> \u2014 a strong phrase, like &#8220;this is he&#8221;<\/li>\n<li><strong>3<\/strong> \u2014 fairly specific<\/li>\n<li><strong>2<\/strong> \u2014 common and ambiguous, like &#8220;hello&#8221;<\/li>\n<li><strong>1<\/strong> \u2014 a weak hint you expect to combine with others<\/li>\n<\/ul>\n<p>If two labels both reach 4, order decides, not size. IVR wins first, then transfer, then screening, then voicemail, then human. A larger score does not override that order.<\/p>\n<h2>What the matching actually sees<\/h2>\n<p>Rules are compared against cleaned-up text, not what the caller literally said. Before matching, the transcript is lowercased, punctuation becomes a space, and apostrophes are removed rather than expanded.<\/p>\n<p>That last one catches people. &#8220;Who&#8217;s calling&#8221; becomes <code>whos calling<\/code>, while &#8220;who is calling&#8221; stays <code>who is calling<\/code>. Two different strings. If callers say both, add both lines.<\/p>\n<p>Hyphens split words, so &#8220;follow-up&#8221; arrives as <code>follow up<\/code>. Chinese characters and Spanish accents are kept as they are, so write them the way they appear in the transcript.<\/p>\n<p>Matching is whole-phrase and looks for complete words. A rule of <code>virtual assistant<\/code> matches inside &#8220;you have reached the virtual assistant for Mark&#8221; but not inside &#8220;virtual assistants&#8221;. Longer phrases are usually the better bet. A single broad word like &#8220;assistant&#8221; also fires when a human says &#8220;can I speak to the assistant?&#8221;.<\/p>\n<h2>Five steps to change something<\/h2>\n<p><strong>1. Back up the file.<\/strong> Copy <code>rules.tsv<\/code> to <code>rules.tsv.bak<\/code>. You will want the old one back at least once.<\/p>\n<p><strong>2. Edit with a real editor.<\/strong> Notepad++ or similar, set to UTF-8, with whitespace visible. The Tab characters have to be visible or you cannot tell them from spaces.<\/p>\n<p><strong>3. Add one to three specific phrases.<\/strong> Not thirty. One or three, from calls you actually heard go wrong.<\/p>\n<p><strong>4. Save, then restart Ecsow completely.<\/strong> The file is read once, at startup. Closing the window is not enough \u2014 exit the program and open it again. There is no reload button.<\/p>\n<p><strong>5. Test it on a call you can predict.<\/strong> Ring a number you already know the answer on: your own voicemail, a screening line, a bank&#8217;s phone menu. Then watch what Ecsow does with it.<\/p>\n<p>A voicemail should get your recording. A screening assistant should get your short reply. A keypad menu should be dropped. If the call lands in the wrong bucket, the rule did not fire \u2014 and that is nearly always a Tab problem, an apostrophe difference, or the wrong copy of the file.<\/p>\n<h2>Four mistakes that cost the most time<\/h2>\n<div style=\"margin:20px 0;border:1px solid #e8ecf1;border-radius:6px;overflow:hidden\">\n<div style=\"display:flex;padding:11px 16px;background:#f7f9fb;border-bottom:1px solid #e8ecf1;font-size:11.5px;letter-spacing:.08em;text-transform:uppercase;color:#8a94a3\"><span style=\"flex:1 1 auto\">Symptom<\/span><span style=\"flex:0 0 200px\">Cause<\/span><\/div>\n<div style=\"display:flex;padding:11px 16px;border-bottom:1px solid #f0f3f6;font-size:13.5px;color:#374151\"><span style=\"flex:1 1 auto\">The rule never fires<\/span><span style=\"flex:0 0 200px\">Spaces where Tabs should be<\/span><\/div>\n<div style=\"display:flex;padding:11px 16px;border-bottom:1px solid #f0f3f6;font-size:13.5px;color:#374151\"><span style=\"flex:1 1 auto\">The rule never fires<\/span><span style=\"flex:0 0 200px\">&#8220;who&#8217;s&#8221; vs &#8220;who is&#8221;<\/span><\/div>\n<div style=\"display:flex;padding:11px 16px;border-bottom:1px solid #f0f3f6;font-size:13.5px;color:#374151\"><span style=\"flex:1 1 auto\">It fires, but the label is wrong<\/span><span style=\"flex:0 0 200px\">Another label scores higher, or wins earlier<\/span><\/div>\n<div style=\"display:flex;padding:11px 16px;font-size:13.5px;color:#374151\"><span style=\"flex:1 1 auto\">Nothing changes at all<\/span><span style=\"flex:0 0 200px\">No restart, or the wrong file is loaded<\/span><\/div>\n<\/div>\n<p>Two more small ones. A <code>#<\/code> at the start of a line is a comment, but a <code>#<\/code> in the middle is part of the phrase. And an extra Tab inside a phrase makes the line invalid, so it is skipped without complaint.<\/p>\n<p>You can confirm which file is loaded, too. The <strong>Rules file<\/strong> field in AI Settings shows the full path it uses. If that path is not the file you edited, that is your answer.<\/p>\n<h2>What the rules cannot fix<\/h2>\n<p>A phrase table can only answer &#8220;what does this text look like?&#8221;. It does not control timing or playback.<\/p>\n<p>If the transcript itself is wrong, no rule will help. Fix the model or the audio first: right language, decent recording, 8 kHz phone audio in, 16 kHz model in.<\/p>\n<p>The rest belong to the application, not the file. A call reported as no human while it is still ringing is a startup-timing issue. A playback timeout is a callback issue. A screening call that waits for a transfer and gives up is policy, not classification.<\/p>\n<h2>Tuning without breaking what works<\/h2>\n<p>Add a little, test on real calls, then decide. Ten to twenty calls tell you more than one.<\/p>\n<p>Two rules of thumb. Do not raise &#8220;hello&#8221; or &#8220;who is this&#8221; to 5 just to fix one case. Both are said by screening assistants too, and you will trade one error for a worse one. And change one rule at a time. Five edits at once tell you nothing about which one worked.<\/p>\n<p>If you have not set the feature up yet, <a href=\"https:\/\/www.ecsow.com\/blog\/ai-enhanced-detection\/\" style=\"color:#2563EB\">start here<\/a>. If your calls are not in English, <a href=\"https:\/\/www.ecsow.com\/blog\/install-ai-detection-model\/\" style=\"color:#2563EB\">install the matching model first<\/a>. Rules for Spanish will not help a model that only understands English.<\/p>\n<h2>Quick answers<\/h2>\n<h3>Do I need to edit this file at all?<\/h3>\n<p>No. The default rules cover normal English calls. Edit it when you hear a specific phrase go wrong more than once.<\/p>\n<h3>Does it matter where I put the file?<\/h3>\n<p>Yes. It is read from the install folder, or from whatever path the Rules file field points to in AI Settings. Only one copy is used.<\/p>\n<h3>Why did my change do nothing?<\/h3>\n<p>Three usual reasons: spaces instead of Tabs, no restart, or the program is reading another copy. Check the <strong>Rules file<\/strong> field in AI Settings first.<\/p>\n<h3>Can I add rules in Spanish or Chinese?<\/h3>\n<p>Yes. Save the file as UTF-8 and keep accents and characters as they appear in the transcript. Chinese needs no spaces between characters unless the transcript has them.<\/p>\n<h3>How many rules is too many?<\/h3>\n<p>There is no limit, but a long list of single words makes labels fight each other. Complete phrases, fewer lines, higher confidence.<\/p>\n<h3>Does a higher weight always win?<\/h3>\n<p>No. A score of 4 is the entry ticket, and then the label order decides: IVR, transfer, screening, voicemail, human.<\/p>\n<p><script type=\"application\/ld+json\">{\"@context\":\"https:\/\/schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"Do I need to edit rules.tsv in Ecsow?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"No. The default rules cover normal English calls. Edit the file when you hear a specific phrase classified wrongly more than once.\"}},{\"@type\":\"Question\",\"name\":\"Where is rules.tsv located?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"In the Ecsow install folder, next to the program. Check the Rules file field in Tools > Options > Voice Activity Detection > AI Settings to confirm which copy is loaded.\"}},{\"@type\":\"Question\",\"name\":\"Why did my rules.tsv change have no effect?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Usually one of three reasons: columns separated by spaces instead of Tab characters, the program was not fully restarted, or a different copy of the file is being loaded. The Rules file field in AI Settings shows the full path of the file in use.\"}},{\"@type\":\"Question\",\"name\":\"Can I write rules in Spanish or Chinese?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes. Save the file as UTF-8 and keep accents and characters as they appear in the transcript. Chinese needs no spaces between characters unless the speech-to-text output contains them.\"}},{\"@type\":\"Question\",\"name\":\"Does a higher weight always win in rules.tsv?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"No. A score of 4 is the threshold, and then label priority decides: IVR first, then transfer, screening, voicemail and human.\"}},{\"@type\":\"Question\",\"name\":\"Can rules.tsv fix a delayed or missed detection?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"No. The rules only classify text. Timing, playback, transfer waits and retries are controlled by the application, not by the rules file.\"}}]}<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Five labels, three Tab-separated columns, one restart. How to teach the AI detector your own phrases without breaking the ones already working.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-90","post","type-post","status-publish","format-standard","hentry","category-setup-and-how-to"],"_links":{"self":[{"href":"https:\/\/www.ecsow.com\/blog\/wp-json\/wp\/v2\/posts\/90","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ecsow.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecsow.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecsow.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecsow.com\/blog\/wp-json\/wp\/v2\/comments?post=90"}],"version-history":[{"count":5,"href":"https:\/\/www.ecsow.com\/blog\/wp-json\/wp\/v2\/posts\/90\/revisions"}],"predecessor-version":[{"id":120,"href":"https:\/\/www.ecsow.com\/blog\/wp-json\/wp\/v2\/posts\/90\/revisions\/120"}],"wp:attachment":[{"href":"https:\/\/www.ecsow.com\/blog\/wp-json\/wp\/v2\/media?parent=90"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecsow.com\/blog\/wp-json\/wp\/v2\/categories?post=90"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecsow.com\/blog\/wp-json\/wp\/v2\/tags?post=90"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}